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
- Version:
- $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 févr. 2011) $
- 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 newMathRuntimeException
with specified nestedThrowable
root 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 newMathRuntimeException
with specified formatted detail message and nestedThrowable
root cause.MathRuntimeException(Localizable pattern, java.lang.Object... arguments)
Constructs a newMathRuntimeException
with specified formatted detail message.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.ArithmeticException
createArithmeticException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateArithmeticException(Localizable, Object...)
static java.lang.ArithmeticException
createArithmeticException(Localizable pattern, java.lang.Object... arguments)
Constructs a newArithmeticException
with specified formatted detail message.static java.lang.ArrayIndexOutOfBoundsException
createArrayIndexOutOfBoundsException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateArrayIndexOutOfBoundsException(Localizable, Object...)
static java.lang.ArrayIndexOutOfBoundsException
createArrayIndexOutOfBoundsException(Localizable pattern, java.lang.Object... arguments)
Constructs a newArrayIndexOutOfBoundsException
with specified formatted detail message.static java.util.ConcurrentModificationException
createConcurrentModificationException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateConcurrentModificationException(Localizable, Object...)
static java.util.ConcurrentModificationException
createConcurrentModificationException(Localizable pattern, java.lang.Object... arguments)
Constructs a newConcurrentModificationException
with specified formatted detail message.static java.io.EOFException
createEOFException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateEOFException(Localizable, Object...)
static java.io.EOFException
createEOFException(Localizable pattern, java.lang.Object... arguments)
Constructs a newEOFException
with specified formatted detail message.static java.lang.IllegalArgumentException
createIllegalArgumentException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateIllegalArgumentException(Localizable, Object...)
static java.lang.IllegalArgumentException
createIllegalArgumentException(java.lang.Throwable rootCause)
Constructs a newIllegalArgumentException
with specified nestedThrowable
root cause.static java.lang.IllegalArgumentException
createIllegalArgumentException(Localizable pattern, java.lang.Object... arguments)
Constructs a newIllegalArgumentException
with specified formatted detail message.static java.lang.IllegalStateException
createIllegalStateException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateIllegalStateException(Localizable, Object...)
static java.lang.IllegalStateException
createIllegalStateException(Localizable pattern, java.lang.Object... arguments)
Constructs a newIllegalStateException
with specified formatted detail message.static java.lang.RuntimeException
createInternalError(java.lang.Throwable cause)
Create anRuntimeException
for an internal error.static java.io.IOException
createIOException(java.lang.Throwable rootCause)
Constructs a newIOException
with specified nestedThrowable
root cause.static java.util.NoSuchElementException
createNoSuchElementException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateNoSuchElementException(Localizable, Object...)
static java.util.NoSuchElementException
createNoSuchElementException(Localizable pattern, java.lang.Object... arguments)
Constructs a newNoSuchElementException
with specified formatted detail message.static java.lang.NullPointerException
createNullPointerException(java.lang.String pattern, java.lang.Object... arguments)
Deprecated.as of 2.2 replaced bycreateNullPointerException(Localizable, Object...)
static java.lang.NullPointerException
createNullPointerException(Localizable pattern, java.lang.Object... arguments)
Deprecated.in 2.2.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...)
static java.text.ParseException
createParseException(int offset, Localizable pattern, java.lang.Object... arguments)
Constructs a newParseException
with specified formatted detail message.static java.lang.UnsupportedOperationException
createUnsupportedOperationException(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.Localizable
getGeneralPattern()
Gets the localizable pattern used to build the general part of the message of this throwable.java.lang.String
getLocalizedMessage()
Gets the message in the system default locale.java.lang.String
getMessage()
Gets the message in a conventional US locale.java.lang.String
getMessage(java.util.Locale locale)
Gets the message in a specified locale.java.lang.String
getPattern()
Deprecated.as of 2.2 replaced bygetSpecificPattern()
andgetGeneralPattern()
Localizable
getSpecificPattern()
Gets the localizable pattern used to build the specific part of the message of this throwable.void
printStackTrace()
Prints the stack trace of this exception to the standard error stream.void
printStackTrace(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 newMathRuntimeException
with 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 newMathRuntimeException
with 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 newMathRuntimeException
with specified nestedThrowable
root 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 newMathRuntimeException
with specified formatted detail message and nestedThrowable
root 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 newMathRuntimeException
with specified formatted detail message and nestedThrowable
root 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:
getSpecificPattern
in 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:
getGeneralPattern
in 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:
getArguments
in 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:
getMessage
in 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:
getMessage
in interfaceMathThrowable
- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- localized message
-
getLocalizedMessage
public java.lang.String getLocalizedMessage()
Gets the message in the system default locale.- Specified by:
getLocalizedMessage
in interfaceMathThrowable
- Overrides:
getLocalizedMessage
in classjava.lang.Throwable
- Returns:
- localized message
-
printStackTrace
public void printStackTrace()
Prints the stack trace of this exception to the standard error stream.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified stream.- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
out
- thePrintStream
to 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 newArithmeticException
with 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 newArithmeticException
with 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 newArrayIndexOutOfBoundsException
with 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 newArrayIndexOutOfBoundsException
with 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 newEOFException
with 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 newEOFException
with 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 newIOException
with specified nestedThrowable
root cause.This factory method allows chaining of other exceptions within an
IOException
even for Java 5. The constructor forIOException
with 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 newIllegalArgumentException
with 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 newIllegalArgumentException
with 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 newIllegalArgumentException
with specified nestedThrowable
root 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 newIllegalStateException
with 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 newIllegalStateException
with 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 newConcurrentModificationException
with 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 newConcurrentModificationException
with 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 newNoSuchElementException
with 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 newNoSuchElementException
with 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 useMathUnsupportedOperationException
instead.Constructs a newUnsupportedOperationException
with 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 newNullPointerException
with 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 newNullPointerException
with 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 newParseException
with 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 newParseException
with 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 anRuntimeException
for an internal error.- Parameters:
cause
- underlying cause- Returns:
- an
RuntimeException
for an internal error
-
-