public class MathRuntimeException extends RuntimeException implements MathThrowable
Modifier and Type | Field and Description |
---|---|
private Object[] |
arguments
Arguments used to build the message.
|
private Localizable |
pattern
Pattern used to build the message.
|
private static long |
serialVersionUID
Serializable version identifier.
|
Constructor and Description |
---|
MathRuntimeException(Localizable pattern,
Object... arguments)
Constructs a new
MathRuntimeException with specified
formatted detail message. |
MathRuntimeException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
MathRuntimeException(Localizable, Object...) |
MathRuntimeException(Throwable rootCause)
Constructs a new
MathRuntimeException with specified
nested Throwable root cause. |
MathRuntimeException(Throwable rootCause,
Localizable pattern,
Object... arguments)
Constructs a new
MathRuntimeException with specified
formatted detail message and nested Throwable root cause. |
MathRuntimeException(Throwable rootCause,
String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
MathRuntimeException(Throwable, Localizable, Object...) |
Modifier and Type | Method and Description |
---|---|
private static String |
buildMessage(Locale locale,
Localizable pattern,
Object... arguments)
Builds a message string by from a pattern and its arguments.
|
static ArithmeticException |
createArithmeticException(Localizable pattern,
Object... arguments)
Constructs a new
ArithmeticException with specified formatted detail message. |
static ArithmeticException |
createArithmeticException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createArithmeticException(Localizable, Object...) |
static ArrayIndexOutOfBoundsException |
createArrayIndexOutOfBoundsException(Localizable pattern,
Object... arguments)
Constructs a new
ArrayIndexOutOfBoundsException with specified formatted detail message. |
static ArrayIndexOutOfBoundsException |
createArrayIndexOutOfBoundsException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createArrayIndexOutOfBoundsException(Localizable, Object...) |
static ConcurrentModificationException |
createConcurrentModificationException(Localizable pattern,
Object... arguments)
Constructs a new
ConcurrentModificationException with specified formatted detail message. |
static ConcurrentModificationException |
createConcurrentModificationException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createConcurrentModificationException(Localizable, Object...) |
static EOFException |
createEOFException(Localizable pattern,
Object... arguments)
Constructs a new
EOFException with specified formatted detail message. |
static EOFException |
createEOFException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createEOFException(Localizable, Object...) |
static IllegalArgumentException |
createIllegalArgumentException(Localizable pattern,
Object... arguments)
Constructs a new
IllegalArgumentException with specified formatted detail message. |
static IllegalArgumentException |
createIllegalArgumentException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createIllegalArgumentException(Localizable, Object...) |
static IllegalArgumentException |
createIllegalArgumentException(Throwable rootCause)
Constructs a new
IllegalArgumentException with specified nested
Throwable root cause. |
static IllegalStateException |
createIllegalStateException(Localizable pattern,
Object... arguments)
Constructs a new
IllegalStateException with specified formatted detail message. |
static IllegalStateException |
createIllegalStateException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createIllegalStateException(Localizable, Object...) |
static RuntimeException |
createInternalError(Throwable cause)
Create an
RuntimeException for an internal error. |
static IOException |
createIOException(Throwable rootCause)
Constructs a new
IOException with specified nested
Throwable root cause. |
static NoSuchElementException |
createNoSuchElementException(Localizable pattern,
Object... arguments)
Constructs a new
NoSuchElementException with specified formatted detail message. |
static NoSuchElementException |
createNoSuchElementException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createNoSuchElementException(Localizable, Object...) |
static NullPointerException |
createNullPointerException(Localizable pattern,
Object... arguments)
Deprecated.
in 2.2. Checks for "null" must not be performed in Commons-Math.
|
static NullPointerException |
createNullPointerException(String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createNullPointerException(Localizable, Object...) |
static ParseException |
createParseException(int offset,
Localizable pattern,
Object... arguments)
Constructs a new
ParseException with specified
formatted detail message. |
static ParseException |
createParseException(int offset,
String pattern,
Object... arguments)
Deprecated.
as of 2.2 replaced by
createParseException(int, Localizable, Object...) |
static UnsupportedOperationException |
createUnsupportedOperationException(Localizable pattern,
Object... arguments)
Deprecated.
in 2.2. Please use
MathUnsupportedOperationException
instead. |
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.
|
String |
getLocalizedMessage()
Gets the message in the system default locale.
|
String |
getMessage()
Gets the message in a conventional US locale.
|
String |
getMessage(Locale locale)
Gets the message in a specified locale.
|
String |
getPattern()
Deprecated.
as of 2.2 replaced by
getSpecificPattern() and getGeneralPattern() |
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(PrintStream out)
Prints the stack trace of this exception to the specified stream.
|
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
private static final long serialVersionUID
private final Localizable pattern
private final Object[] arguments
@Deprecated public MathRuntimeException(String pattern, Object... arguments)
MathRuntimeException(Localizable, Object...)
MathRuntimeException
with specified
formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic MathRuntimeException(Localizable pattern, Object... arguments)
MathRuntimeException
with specified
formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic MathRuntimeException(Throwable rootCause)
MathRuntimeException
with specified
nested Throwable
root cause.rootCause
- the exception or error that caused this exception
to be thrown.@Deprecated public MathRuntimeException(Throwable rootCause, String pattern, Object... arguments)
MathRuntimeException(Throwable, Localizable, Object...)
MathRuntimeException
with specified
formatted detail message and nested Throwable
root cause.
Message formatting is delegated to MessageFormat
.rootCause
- the exception or error that caused this exception
to be thrown.pattern
- format specifierarguments
- format argumentspublic MathRuntimeException(Throwable rootCause, Localizable pattern, Object... arguments)
MathRuntimeException
with specified
formatted detail message and nested Throwable
root cause.
Message formatting is delegated to MessageFormat
.rootCause
- the exception or error that caused this exception
to be thrown.pattern
- format specifierarguments
- format argumentsprivate static String buildMessage(Locale locale, Localizable pattern, Object... arguments)
locale
- Locale in which the message should be translatedpattern
- format specifierarguments
- format arguments@Deprecated public String getPattern()
public Localizable getSpecificPattern()
getSpecificPattern
in interface MathThrowable
public Localizable getGeneralPattern()
getGeneralPattern
in interface MathThrowable
public Object[] getArguments()
getArguments
in interface MathThrowable
public String getMessage(Locale locale)
getMessage
in interface MathThrowable
locale
- Locale in which the message should be translatedpublic String getMessage()
getMessage
in interface MathThrowable
getMessage
in class Throwable
public String getLocalizedMessage()
getLocalizedMessage
in interface MathThrowable
getLocalizedMessage
in class Throwable
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintStream out)
printStackTrace
in class Throwable
out
- the PrintStream
to use for output@Deprecated public static ArithmeticException createArithmeticException(String pattern, Object... arguments)
createArithmeticException(Localizable, Object...)
ArithmeticException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static ArithmeticException createArithmeticException(Localizable pattern, Object... arguments)
ArithmeticException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(String pattern, Object... arguments)
createArrayIndexOutOfBoundsException(Localizable, Object...)
ArrayIndexOutOfBoundsException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(Localizable pattern, Object... arguments)
ArrayIndexOutOfBoundsException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static EOFException createEOFException(String pattern, Object... arguments)
createEOFException(Localizable, Object...)
EOFException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static EOFException createEOFException(Localizable pattern, Object... arguments)
EOFException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static IOException createIOException(Throwable rootCause)
IOException
with specified nested
Throwable
root cause.
This factory method allows chaining of other exceptions within an
IOException
even for Java 5. The constructor for
IOException
with a cause parameter was introduced only
with Java 6.
rootCause
- the exception or error that caused this exception
to be thrown.@Deprecated public static IllegalArgumentException createIllegalArgumentException(String pattern, Object... arguments)
createIllegalArgumentException(Localizable, Object...)
IllegalArgumentException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static IllegalArgumentException createIllegalArgumentException(Localizable pattern, Object... arguments)
IllegalArgumentException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static IllegalArgumentException createIllegalArgumentException(Throwable rootCause)
IllegalArgumentException
with specified nested
Throwable
root cause.rootCause
- the exception or error that caused this exception
to be thrown.@Deprecated public static IllegalStateException createIllegalStateException(String pattern, Object... arguments)
createIllegalStateException(Localizable, Object...)
IllegalStateException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static IllegalStateException createIllegalStateException(Localizable pattern, Object... arguments)
IllegalStateException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static ConcurrentModificationException createConcurrentModificationException(String pattern, Object... arguments)
createConcurrentModificationException(Localizable, Object...)
ConcurrentModificationException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static ConcurrentModificationException createConcurrentModificationException(Localizable pattern, Object... arguments)
ConcurrentModificationException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static NoSuchElementException createNoSuchElementException(String pattern, Object... arguments)
createNoSuchElementException(Localizable, Object...)
NoSuchElementException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format argumentspublic static NoSuchElementException createNoSuchElementException(Localizable pattern, Object... arguments)
NoSuchElementException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static UnsupportedOperationException createUnsupportedOperationException(Localizable pattern, Object... arguments)
MathUnsupportedOperationException
instead.UnsupportedOperationException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static NullPointerException createNullPointerException(String pattern, Object... arguments)
createNullPointerException(Localizable, Object...)
NullPointerException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static NullPointerException createNullPointerException(Localizable pattern, Object... arguments)
NullPointerException
with specified formatted detail message.
Message formatting is delegated to MessageFormat
.pattern
- format specifierarguments
- format arguments@Deprecated public static ParseException createParseException(int offset, String pattern, Object... arguments)
createParseException(int, Localizable, Object...)
ParseException
with specified
formatted detail message.
Message formatting is delegated to MessageFormat
.offset
- offset at which error occurredpattern
- format specifierarguments
- format argumentspublic static ParseException createParseException(int offset, Localizable pattern, Object... arguments)
ParseException
with specified
formatted detail message.
Message formatting is delegated to MessageFormat
.offset
- offset at which error occurredpattern
- format specifierarguments
- format argumentspublic static RuntimeException createInternalError(Throwable cause)
RuntimeException
for an internal error.cause
- underlying causeRuntimeException
for an internal errorCopyright (c) 2003-2014 Apache Software Foundation