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:
 java.io.Serializable,MathThrowable
- Direct Known Subclasses:
 InvalidMatrixException,MatrixIndexException,MatrixVisitorException
public class MathRuntimeException extends java.lang.RuntimeException implements MathThrowable
Base class for commons-math unchecked exceptions.- Since:
 - 2.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description MathRuntimeException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced byMathRuntimeException(Localizable, Object...)MathRuntimeException(java.lang.Throwable rootCause)Constructs a newMathRuntimeExceptionwith specified nestedThrowableroot cause.MathRuntimeException(java.lang.Throwable rootCause, java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced byMathRuntimeException(Throwable, Localizable, Object...)MathRuntimeException(java.lang.Throwable rootCause, Localizable pattern, java.lang.Object... arguments)Constructs a newMathRuntimeExceptionwith specified formatted detail message and nestedThrowableroot cause.MathRuntimeException(Localizable pattern, java.lang.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 java.lang.ArithmeticExceptioncreateArithmeticException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateArithmeticException(Localizable, Object...)static java.lang.ArithmeticExceptioncreateArithmeticException(Localizable pattern, java.lang.Object... arguments)Constructs a newArithmeticExceptionwith specified formatted detail message.static java.lang.ArrayIndexOutOfBoundsExceptioncreateArrayIndexOutOfBoundsException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateArrayIndexOutOfBoundsException(Localizable, Object...)static java.lang.ArrayIndexOutOfBoundsExceptioncreateArrayIndexOutOfBoundsException(Localizable pattern, java.lang.Object... arguments)Constructs a newArrayIndexOutOfBoundsExceptionwith specified formatted detail message.static java.util.ConcurrentModificationExceptioncreateConcurrentModificationException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateConcurrentModificationException(Localizable, Object...)static java.util.ConcurrentModificationExceptioncreateConcurrentModificationException(Localizable pattern, java.lang.Object... arguments)Constructs a newConcurrentModificationExceptionwith specified formatted detail message.static java.io.EOFExceptioncreateEOFException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateEOFException(Localizable, Object...)static java.io.EOFExceptioncreateEOFException(Localizable pattern, java.lang.Object... arguments)Constructs a newEOFExceptionwith specified formatted detail message.static java.lang.IllegalArgumentExceptioncreateIllegalArgumentException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateIllegalArgumentException(Localizable, Object...)static java.lang.IllegalArgumentExceptioncreateIllegalArgumentException(java.lang.Throwable rootCause)Constructs a newIllegalArgumentExceptionwith specified nestedThrowableroot cause.static java.lang.IllegalArgumentExceptioncreateIllegalArgumentException(Localizable pattern, java.lang.Object... arguments)Constructs a newIllegalArgumentExceptionwith specified formatted detail message.static java.lang.IllegalStateExceptioncreateIllegalStateException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateIllegalStateException(Localizable, Object...)static java.lang.IllegalStateExceptioncreateIllegalStateException(Localizable pattern, java.lang.Object... arguments)Constructs a newIllegalStateExceptionwith specified formatted detail message.static java.lang.RuntimeExceptioncreateInternalError(java.lang.Throwable cause)Create anRuntimeExceptionfor an internal error.static java.io.IOExceptioncreateIOException(java.lang.Throwable rootCause)Constructs a newIOExceptionwith specified nestedThrowableroot cause.static java.util.NoSuchElementExceptioncreateNoSuchElementException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateNoSuchElementException(Localizable, Object...)static java.util.NoSuchElementExceptioncreateNoSuchElementException(Localizable pattern, java.lang.Object... arguments)Constructs a newNoSuchElementExceptionwith specified formatted detail message.static java.lang.NullPointerExceptioncreateNullPointerException(java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateNullPointerException(Localizable, Object...)static java.lang.NullPointerExceptioncreateNullPointerException(Localizable pattern, java.lang.Object... arguments)Deprecated.in 2.2.static java.text.ParseExceptioncreateParseException(int offset, java.lang.String pattern, java.lang.Object... arguments)Deprecated.as of 2.2 replaced bycreateParseException(int, Localizable, Object...)static java.text.ParseExceptioncreateParseException(int offset, Localizable pattern, java.lang.Object... arguments)Constructs a newParseExceptionwith specified formatted detail message.static java.lang.UnsupportedOperationExceptioncreateUnsupportedOperationException(Localizable pattern, java.lang.Object... arguments)Deprecated.in 2.2.java.lang.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.java.lang.StringgetLocalizedMessage()Gets the message in the system default locale.java.lang.StringgetMessage()Gets the message in a conventional US locale.java.lang.StringgetMessage(java.util.Locale locale)Gets the message in a specified locale.java.lang.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(java.io.PrintStream out)Prints the stack trace of this exception to the specified stream. 
 - 
 
- 
- 
Constructor Detail
- 
MathRuntimeException
@Deprecated public MathRuntimeException(java.lang.String pattern, java.lang.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, java.lang.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(java.lang.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(java.lang.Throwable rootCause, java.lang.String pattern, java.lang.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(java.lang.Throwable rootCause, Localizable pattern, java.lang.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 java.lang.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 java.lang.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 java.lang.String getMessage(java.util.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 java.lang.String getMessage()
Gets the message in a conventional US locale.- Specified by:
 getMessagein interfaceMathThrowable- Overrides:
 getMessagein classjava.lang.Throwable- Returns:
 - localized message
 
 
- 
getLocalizedMessage
public java.lang.String getLocalizedMessage()
Gets the message in the system default locale.- Specified by:
 getLocalizedMessagein interfaceMathThrowable- Overrides:
 getLocalizedMessagein classjava.lang.Throwable- Returns:
 - localized message
 
 
- 
printStackTrace
public void printStackTrace()
Prints the stack trace of this exception to the standard error stream.- Overrides:
 printStackTracein classjava.lang.Throwable
 
- 
printStackTrace
public void printStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified stream.- Overrides:
 printStackTracein classjava.lang.Throwable- Parameters:
 out- thePrintStreamto use for output
 
- 
createArithmeticException
@Deprecated public static java.lang.ArithmeticException createArithmeticException(java.lang.String pattern, java.lang.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 java.lang.ArithmeticException createArithmeticException(Localizable pattern, java.lang.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 java.lang.ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(java.lang.String pattern, java.lang.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 java.lang.ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(Localizable pattern, java.lang.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 java.io.EOFException createEOFException(java.lang.String pattern, java.lang.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 java.io.EOFException createEOFException(Localizable pattern, java.lang.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 java.io.IOException createIOException(java.lang.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 java.lang.IllegalArgumentException createIllegalArgumentException(java.lang.String pattern, java.lang.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 java.lang.IllegalArgumentException createIllegalArgumentException(Localizable pattern, java.lang.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 java.lang.IllegalArgumentException createIllegalArgumentException(java.lang.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 java.lang.IllegalStateException createIllegalStateException(java.lang.String pattern, java.lang.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 java.lang.IllegalStateException createIllegalStateException(Localizable pattern, java.lang.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 java.util.ConcurrentModificationException createConcurrentModificationException(java.lang.String pattern, java.lang.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 java.util.ConcurrentModificationException createConcurrentModificationException(Localizable pattern, java.lang.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 java.util.NoSuchElementException createNoSuchElementException(java.lang.String pattern, java.lang.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 java.util.NoSuchElementException createNoSuchElementException(Localizable pattern, java.lang.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 java.lang.UnsupportedOperationException createUnsupportedOperationException(Localizable pattern, java.lang.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 java.lang.NullPointerException createNullPointerException(java.lang.String pattern, java.lang.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 java.lang.NullPointerException createNullPointerException(Localizable pattern, java.lang.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 java.text.ParseException createParseException(int offset, java.lang.String pattern, java.lang.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 java.text.ParseException createParseException(int offset, Localizable pattern, java.lang.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 java.lang.RuntimeException createInternalError(java.lang.Throwable cause)
Create anRuntimeExceptionfor an internal error.- Parameters:
 cause- underlying cause- Returns:
 - an 
RuntimeExceptionfor an internal error 
 
 - 
 
 -