Package org.apache.commons.math
Class MathRuntimeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.commons.math.MathRuntimeException
- All Implemented Interfaces:
Serializable,MathThrowable
- Direct Known Subclasses:
InvalidMatrixException,MatrixIndexException,MatrixVisitorException
Base class for commons-math unchecked exceptions.
- Since:
- 2.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMathRuntimeException(String pattern, Object... arguments) Deprecated.MathRuntimeException(Throwable rootCause) Constructs a newMathRuntimeExceptionwith specified nestedThrowableroot cause.MathRuntimeException(Throwable rootCause, String pattern, Object... arguments) Deprecated.as of 2.2 replaced byMathRuntimeException(Throwable, Localizable, Object...)MathRuntimeException(Throwable rootCause, Localizable pattern, Object... arguments) Constructs a newMathRuntimeExceptionwith specified formatted detail message and nestedThrowableroot cause.MathRuntimeException(Localizable pattern, Object... arguments) Constructs a newMathRuntimeExceptionwith specified formatted detail message. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArithmeticExceptioncreateArithmeticException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateArithmeticException(Localizable, Object...)static ArithmeticExceptioncreateArithmeticException(Localizable pattern, Object... arguments) Constructs a newArithmeticExceptionwith specified formatted detail message.createArrayIndexOutOfBoundsException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateArrayIndexOutOfBoundsException(Localizable, Object...)createArrayIndexOutOfBoundsException(Localizable pattern, Object... arguments) Constructs a newArrayIndexOutOfBoundsExceptionwith specified formatted detail message.createConcurrentModificationException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateConcurrentModificationException(Localizable, Object...)createConcurrentModificationException(Localizable pattern, Object... arguments) Constructs a newConcurrentModificationExceptionwith specified formatted detail message.static EOFExceptioncreateEOFException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateEOFException(Localizable, Object...)static EOFExceptioncreateEOFException(Localizable pattern, Object... arguments) Constructs a newEOFExceptionwith specified formatted detail message.static IllegalArgumentExceptioncreateIllegalArgumentException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateIllegalArgumentException(Localizable, Object...)static IllegalArgumentExceptioncreateIllegalArgumentException(Throwable rootCause) Constructs a newIllegalArgumentExceptionwith specified nestedThrowableroot cause.static IllegalArgumentExceptioncreateIllegalArgumentException(Localizable pattern, Object... arguments) Constructs a newIllegalArgumentExceptionwith specified formatted detail message.static IllegalStateExceptioncreateIllegalStateException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateIllegalStateException(Localizable, Object...)static IllegalStateExceptioncreateIllegalStateException(Localizable pattern, Object... arguments) Constructs a newIllegalStateExceptionwith specified formatted detail message.static RuntimeExceptioncreateInternalError(Throwable cause) Create anRuntimeExceptionfor an internal error.static IOExceptioncreateIOException(Throwable rootCause) Constructs a newIOExceptionwith specified nestedThrowableroot cause.static NoSuchElementExceptioncreateNoSuchElementException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateNoSuchElementException(Localizable, Object...)static NoSuchElementExceptioncreateNoSuchElementException(Localizable pattern, Object... arguments) Constructs a newNoSuchElementExceptionwith specified formatted detail message.static NullPointerExceptioncreateNullPointerException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateNullPointerException(Localizable, Object...)static NullPointerExceptioncreateNullPointerException(Localizable pattern, Object... arguments) Deprecated.in 2.2.static ParseExceptioncreateParseException(int offset, String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateParseException(int, Localizable, Object...)static ParseExceptioncreateParseException(int offset, Localizable pattern, Object... arguments) Constructs a newParseExceptionwith specified formatted detail message.createUnsupportedOperationException(Localizable pattern, Object... arguments) Deprecated.in 2.2.Object[]Gets the arguments used to build the message of this throwable.Gets the localizable pattern used to build the general part of the message of this throwable.Gets the message in the system default locale.Gets the message in a conventional US locale.getMessage(Locale locale) Gets the message in a specified locale.Deprecated.as of 2.2 replaced bygetSpecificPattern()andgetGeneralPattern()Gets the localizable pattern used to build the specific part of the message of this throwable.voidPrints the stack trace of this exception to the standard error stream.voidPrints the stack trace of this exception to the specified stream.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MathRuntimeException
Deprecated.as of 2.2 replaced byMathRuntimeException(Localizable, Object...)Constructs a newMathRuntimeExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments
-
MathRuntimeException
Constructs a newMathRuntimeExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Since:
- 2.2
-
MathRuntimeException
Constructs a newMathRuntimeExceptionwith specified nestedThrowableroot cause.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.
-
MathRuntimeException
Deprecated.as of 2.2 replaced byMathRuntimeException(Throwable, Localizable, Object...)Constructs a newMathRuntimeExceptionwith specified formatted detail message and nestedThrowableroot cause. Message formatting is delegated toMessageFormat.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.pattern- format specifierarguments- format arguments
-
MathRuntimeException
Constructs a newMathRuntimeExceptionwith specified formatted detail message and nestedThrowableroot cause. Message formatting is delegated toMessageFormat.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.pattern- format specifierarguments- format arguments- Since:
- 2.2
-
-
Method Details
-
getPattern
Deprecated.as of 2.2 replaced bygetSpecificPattern()andgetGeneralPattern()Gets the pattern used to build the message of this throwable.- Returns:
- the pattern used to build the message of this throwable
-
getSpecificPattern
Gets the localizable pattern used to build the specific part of the message of this throwable.- Specified by:
getSpecificPatternin interfaceMathThrowable- Returns:
- localizable pattern used to build the specific part of the message of this throwable
- Since:
- 2.2
-
getGeneralPattern
Gets the localizable pattern used to build the general part of the message of this throwable.- Specified by:
getGeneralPatternin interfaceMathThrowable- Returns:
- localizable pattern used to build the general part of the message of this throwable
- Since:
- 2.2
-
getArguments
Gets the arguments used to build the message of this throwable.- Specified by:
getArgumentsin interfaceMathThrowable- Returns:
- the arguments used to build the message of this throwable
-
getMessage
Gets the message in a specified locale.- Specified by:
getMessagein interfaceMathThrowable- Parameters:
locale- Locale in which the message should be translated- Returns:
- localized message
-
getMessage
Gets the message in a conventional US locale.- Specified by:
getMessagein interfaceMathThrowable- Overrides:
getMessagein classThrowable- Returns:
- localized message
-
getLocalizedMessage
Gets the message in the system default locale.- Specified by:
getLocalizedMessagein interfaceMathThrowable- Overrides:
getLocalizedMessagein classThrowable- Returns:
- localized message
-
printStackTrace
public void printStackTrace()Prints the stack trace of this exception to the standard error stream.- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints the stack trace of this exception to the specified stream.- Overrides:
printStackTracein classThrowable- Parameters:
out- thePrintStreamto use for output
-
createArithmeticException
@Deprecated public static ArithmeticException createArithmeticException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateArithmeticException(Localizable, Object...)Constructs a newArithmeticExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createArithmeticException
public static ArithmeticException createArithmeticException(Localizable pattern, Object... arguments) Constructs a newArithmeticExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createArrayIndexOutOfBoundsException
@Deprecated public static ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateArrayIndexOutOfBoundsException(Localizable, Object...)Constructs a newArrayIndexOutOfBoundsExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createArrayIndexOutOfBoundsException
public static ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(Localizable pattern, Object... arguments) Constructs a newArrayIndexOutOfBoundsExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createEOFException
Deprecated.as of 2.2 replaced bycreateEOFException(Localizable, Object...)Constructs a newEOFExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createEOFException
Constructs a newEOFExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createIOException
Constructs a newIOExceptionwith specified nestedThrowableroot cause.This factory method allows chaining of other exceptions within an
IOExceptioneven for Java 5. The constructor forIOExceptionwith a cause parameter was introduced only with Java 6.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.- Returns:
- built exception
-
createIllegalArgumentException
@Deprecated public static IllegalArgumentException createIllegalArgumentException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateIllegalArgumentException(Localizable, Object...)Constructs a newIllegalArgumentExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createIllegalArgumentException
public static IllegalArgumentException createIllegalArgumentException(Localizable pattern, Object... arguments) Constructs a newIllegalArgumentExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createIllegalArgumentException
Constructs a newIllegalArgumentExceptionwith specified nestedThrowableroot cause.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.- Returns:
- built exception
-
createIllegalStateException
@Deprecated public static IllegalStateException createIllegalStateException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateIllegalStateException(Localizable, Object...)Constructs a newIllegalStateExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createIllegalStateException
public static IllegalStateException createIllegalStateException(Localizable pattern, Object... arguments) Constructs a newIllegalStateExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createConcurrentModificationException
@Deprecated public static ConcurrentModificationException createConcurrentModificationException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateConcurrentModificationException(Localizable, Object...)Constructs a newConcurrentModificationExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createConcurrentModificationException
public static ConcurrentModificationException createConcurrentModificationException(Localizable pattern, Object... arguments) Constructs a newConcurrentModificationExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createNoSuchElementException
@Deprecated public static NoSuchElementException createNoSuchElementException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateNoSuchElementException(Localizable, Object...)Constructs a newNoSuchElementExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createNoSuchElementException
public static NoSuchElementException createNoSuchElementException(Localizable pattern, Object... arguments) Constructs a newNoSuchElementExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createUnsupportedOperationException
@Deprecated public static UnsupportedOperationException createUnsupportedOperationException(Localizable pattern, Object... arguments) Deprecated.in 2.2. Please useMathUnsupportedOperationExceptioninstead.Constructs a newUnsupportedOperationExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createNullPointerException
@Deprecated public static NullPointerException createNullPointerException(String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateNullPointerException(Localizable, Object...)Constructs a newNullPointerExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
-
createNullPointerException
@Deprecated public static NullPointerException createNullPointerException(Localizable pattern, Object... arguments) Deprecated.in 2.2. Checks for "null" must not be performed in Commons-Math.Constructs a newNullPointerExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createParseException
@Deprecated public static ParseException createParseException(int offset, String pattern, Object... arguments) Deprecated.as of 2.2 replaced bycreateParseException(int, Localizable, Object...)Constructs a newParseExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
offset- offset at which error occurredpattern- format specifierarguments- format arguments- Returns:
- built exception
-
createParseException
public static ParseException createParseException(int offset, Localizable pattern, Object... arguments) Constructs a newParseExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
offset- offset at which error occurredpattern- format specifierarguments- format arguments- Returns:
- built exception
- Since:
- 2.2
-
createInternalError
Create anRuntimeExceptionfor an internal error.- Parameters:
cause- underlying cause- Returns:
- an
RuntimeExceptionfor an internal error
-
MathRuntimeException(Localizable, Object...)