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
public class MathRuntimeException extends RuntimeException implements MathThrowable
Base class for commons-math unchecked exceptions.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MathRuntimeException(String pattern, Object... arguments)Deprecated.as of 2.2 replaced byMathRuntimeException(Localizable, Object...)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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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.static ArrayIndexOutOfBoundsExceptioncreateArrayIndexOutOfBoundsException(String pattern, Object... arguments)Deprecated.as of 2.2 replaced bycreateArrayIndexOutOfBoundsException(Localizable, Object...)static ArrayIndexOutOfBoundsExceptioncreateArrayIndexOutOfBoundsException(Localizable pattern, Object... arguments)Constructs a newArrayIndexOutOfBoundsExceptionwith specified formatted detail message.static ConcurrentModificationExceptioncreateConcurrentModificationException(String pattern, Object... arguments)Deprecated.as of 2.2 replaced bycreateConcurrentModificationException(Localizable, Object...)static ConcurrentModificationExceptioncreateConcurrentModificationException(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.static UnsupportedOperationExceptioncreateUnsupportedOperationException(Localizable pattern, Object... arguments)Deprecated.in 2.2.Object[]getArguments()Gets the arguments used to build the message of this throwable.LocalizablegetGeneralPattern()Gets the localizable pattern used to build the general part of the message of this throwable.StringgetLocalizedMessage()Gets the message in the system default locale.StringgetMessage()Gets the message in a conventional US locale.StringgetMessage(Locale locale)Gets the message in a specified locale.StringgetPattern()Deprecated.as of 2.2 replaced bygetSpecificPattern()andgetGeneralPattern()LocalizablegetSpecificPattern()Gets the localizable pattern used to build the specific part of the message of this throwable.voidprintStackTrace()Prints the stack trace of this exception to the standard error stream.voidprintStackTrace(PrintStream out)Prints 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 Detail
-
MathRuntimeException
@Deprecated public MathRuntimeException(String pattern, Object... arguments)
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
public MathRuntimeException(Localizable pattern, Object... arguments)
Constructs a newMathRuntimeExceptionwith specified formatted detail message. Message formatting is delegated toMessageFormat.- Parameters:
pattern- format specifierarguments- format arguments- Since:
- 2.2
-
MathRuntimeException
public MathRuntimeException(Throwable rootCause)
Constructs a newMathRuntimeExceptionwith specified nestedThrowableroot cause.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.
-
MathRuntimeException
@Deprecated public MathRuntimeException(Throwable rootCause, String pattern, Object... arguments)
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
public MathRuntimeException(Throwable rootCause, Localizable pattern, Object... arguments)
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 Detail
-
getPattern
@Deprecated public String 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
public Localizable 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
public Localizable 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
public Object[] 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
public String getMessage(Locale locale)
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
public String getMessage()
Gets the message in a conventional US locale.- Specified by:
getMessagein interfaceMathThrowable- Overrides:
getMessagein classThrowable- Returns:
- localized message
-
getLocalizedMessage
public String 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
public void printStackTrace(PrintStream out)
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 public static EOFException createEOFException(String pattern, Object... arguments)
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
public static EOFException createEOFException(Localizable pattern, Object... arguments)
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
public static IOException createIOException(Throwable rootCause)
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
public static IllegalArgumentException createIllegalArgumentException(Throwable rootCause)
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
public static RuntimeException createInternalError(Throwable cause)
Create anRuntimeExceptionfor an internal error.- Parameters:
cause- underlying cause- Returns:
- an
RuntimeExceptionfor an internal error
-
-