Class MathArithmeticException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.ArithmeticException
org.apache.commons.math3.exception.MathArithmeticException
- All Implemented Interfaces:
Serializable
,ExceptionContextProvider
public class MathArithmeticException
extends ArithmeticException
implements ExceptionContextProvider
Base class for arithmetic exceptions.
It is used for all the exceptions that have the semantics of the standard
ArithmeticException
, but must also provide a localized
message.- Since:
- 3.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.MathArithmeticException
(Localizable pattern, Object... args) Constructor with a specific message. -
Method Summary
Modifier and TypeMethodDescriptionGets a reference to the "rich context" data structure that allows to customize error messages and store key, value pairs in exceptions.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MathArithmeticException
public MathArithmeticException()Default constructor. -
MathArithmeticException
Constructor with a specific message.- Parameters:
pattern
- Message pattern providing the specific context of the error.args
- Arguments.
-
-
Method Details
-
getContext
Gets a reference to the "rich context" data structure that allows to customize error messages and store key, value pairs in exceptions.- Specified by:
getContext
in interfaceExceptionContextProvider
- Returns:
- a reference to the exception context.
-
getMessage
- Overrides:
getMessage
in classThrowable
-
getLocalizedMessage
- Overrides:
getLocalizedMessage
in classThrowable
-