org.apache.commons.math
Class MathRuntimeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.commons.math.MathRuntimeException
All Implemented Interfaces:
java.io.Serializable

Deprecated. To be removed before 3.0. Please do not use in any new code.

public class MathRuntimeException
extends java.lang.RuntimeException

Base class for commons-math unchecked exceptions.

Since:
2.0
Version:
$Id: MathRuntimeException.java 1178040 2011-10-01 16:23:48Z erans $
See Also:
Serialized Form

Constructor Summary
MathRuntimeException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new MathRuntimeException with specified formatted detail message.
MathRuntimeException(java.lang.Throwable rootCause)
          Deprecated. Constructs a new MathRuntimeException with specified nested Throwable root cause.
MathRuntimeException(java.lang.Throwable rootCause, Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new MathRuntimeException with specified formatted detail message and nested Throwable root cause.
 
Method Summary
 void addMessage(Localizable pat, java.lang.Object... args)
          Deprecated. Sets a message.
static java.lang.ArithmeticException createArithmeticException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new ArithmeticException with specified formatted detail message.
static java.lang.ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new ArrayIndexOutOfBoundsException with specified formatted detail message.
static java.util.ConcurrentModificationException createConcurrentModificationException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new ConcurrentModificationException with specified formatted detail message.
static java.io.EOFException createEOFException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new EOFException with specified formatted detail message.
static java.lang.IllegalArgumentException createIllegalArgumentException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new IllegalArgumentException with specified formatted detail message.
static java.lang.IllegalArgumentException createIllegalArgumentException(java.lang.Throwable rootCause)
          Deprecated. Constructs a new IllegalArgumentException with specified nested Throwable root cause.
static java.lang.IllegalStateException createIllegalStateException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new IllegalStateException with specified formatted detail message.
static java.lang.RuntimeException createInternalError(java.lang.Throwable cause)
          Deprecated. Create an RuntimeException for an internal error.
static java.io.IOException createIOException(java.lang.Throwable rootCause)
          Deprecated. Constructs a new IOException with specified nested Throwable root cause.
static java.util.NoSuchElementException createNoSuchElementException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new NoSuchElementException with specified formatted detail message.
static java.text.ParseException createParseException(int offset, Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new ParseException with specified formatted detail message.
 java.lang.Object getContext(java.lang.String key)
          Deprecated. Gets the value associated to the given context key.
 java.util.Set<java.lang.String> getContextKeys()
          Deprecated. Gets all the keys stored in the exception
 java.lang.String getLocalizedMessage()
          Deprecated. Gets the message in the system default locale.
 java.lang.String getMessage()
          Deprecated. Gets the message in a conventional US locale.
 java.lang.String getMessage(java.util.Locale locale)
          Deprecated. Gets the message in a specified locale.
 void printStackTrace()
          Deprecated. Prints the stack trace of this exception to the standard error stream.
 void printStackTrace(java.io.PrintStream out)
          Deprecated. Prints the stack trace of this exception to the specified stream.
 void setContext(java.lang.String key, java.lang.Object value)
          Deprecated. Sets the context (key, value) pair.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MathRuntimeException

public MathRuntimeException(Localizable pattern,
                            java.lang.Object... arguments)
Deprecated. 
Constructs a new MathRuntimeException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Since:
2.2

MathRuntimeException

public MathRuntimeException(java.lang.Throwable rootCause)
Deprecated. 
Constructs a new MathRuntimeException with specified nested Throwable root cause.

Parameters:
rootCause - the exception or error that caused this exception to be thrown.

MathRuntimeException

public MathRuntimeException(java.lang.Throwable rootCause,
                            Localizable pattern,
                            java.lang.Object... arguments)
Deprecated. 
Constructs a new MathRuntimeException with specified formatted detail message and nested Throwable root cause. Message formatting is delegated to MessageFormat.

Parameters:
rootCause - the exception or error that caused this exception to be thrown.
pattern - format specifier
arguments - format arguments
Since:
2.2
Method Detail

addMessage

public void addMessage(Localizable pat,
                       java.lang.Object... args)
Deprecated. 
Sets a message.

Parameters:
pat - Message pattern.
args - Values for replacing the placeholders in the message pattern.

setContext

public void setContext(java.lang.String key,
                       java.lang.Object value)
Deprecated. 
Sets the context (key, value) pair. Keys are assumed to be unique within an instance. If the same key is assigned a new value, the previous one will be lost.

Parameters:
key - Context key (not null).
value - Context value.

getContext

public java.lang.Object getContext(java.lang.String key)
Deprecated. 
Gets the value associated to the given context key.

Parameters:
key - Context key.
Returns:
the context value or null if the key does not exist.

getContextKeys

public java.util.Set<java.lang.String> getContextKeys()
Deprecated. 
Gets all the keys stored in the exception

Returns:
the set of keys.

getMessage

public java.lang.String getMessage(java.util.Locale locale)
Deprecated. 
Gets the message in a specified locale.

Parameters:
locale - Locale in which the message should be translated
Returns:
localized message

getMessage

public java.lang.String getMessage()
Deprecated. 
Gets the message in a conventional US locale.

Overrides:
getMessage in class java.lang.Throwable
Returns:
localized message

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Deprecated. 
Gets the message in the system default locale.

Overrides:
getLocalizedMessage in class java.lang.Throwable
Returns:
localized message

printStackTrace

public void printStackTrace()
Deprecated. 
Prints the stack trace of this exception to the standard error stream.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream out)
Deprecated. 
Prints the stack trace of this exception to the specified stream.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
out - the PrintStream to use for output

createArithmeticException

public static java.lang.ArithmeticException createArithmeticException(Localizable pattern,
                                                                      java.lang.Object... arguments)
Deprecated. 
Constructs a new ArithmeticException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createArrayIndexOutOfBoundsException

public static java.lang.ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(Localizable pattern,
                                                                                            java.lang.Object... arguments)
Deprecated. 
Constructs a new ArrayIndexOutOfBoundsException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createEOFException

public static java.io.EOFException createEOFException(Localizable pattern,
                                                      java.lang.Object... arguments)
Deprecated. 
Constructs a new EOFException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createIOException

public static java.io.IOException createIOException(java.lang.Throwable rootCause)
Deprecated. 
Constructs a new 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.

Parameters:
rootCause - the exception or error that caused this exception to be thrown.
Returns:
built exception

createIllegalArgumentException

public static java.lang.IllegalArgumentException createIllegalArgumentException(Localizable pattern,
                                                                                java.lang.Object... arguments)
Deprecated. 
Constructs a new IllegalArgumentException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createIllegalArgumentException

public static java.lang.IllegalArgumentException createIllegalArgumentException(java.lang.Throwable rootCause)
Deprecated. 
Constructs a new IllegalArgumentException with specified nested Throwable root cause.

Parameters:
rootCause - the exception or error that caused this exception to be thrown.
Returns:
built exception

createIllegalStateException

public static java.lang.IllegalStateException createIllegalStateException(Localizable pattern,
                                                                          java.lang.Object... arguments)
Deprecated. 
Constructs a new IllegalStateException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createConcurrentModificationException

public static java.util.ConcurrentModificationException createConcurrentModificationException(Localizable pattern,
                                                                                              java.lang.Object... arguments)
Deprecated. 
Constructs a new ConcurrentModificationException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createNoSuchElementException

public static java.util.NoSuchElementException createNoSuchElementException(Localizable pattern,
                                                                            java.lang.Object... arguments)
Deprecated. 
Constructs a new NoSuchElementException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createParseException

public static java.text.ParseException createParseException(int offset,
                                                            Localizable pattern,
                                                            java.lang.Object... arguments)
Deprecated. 
Constructs a new ParseException with specified formatted detail message. Message formatting is delegated to MessageFormat.

Parameters:
offset - offset at which error occurred
pattern - format specifier
arguments - format arguments
Returns:
built exception
Since:
2.2

createInternalError

public static java.lang.RuntimeException createInternalError(java.lang.Throwable cause)
Deprecated. 
Create an RuntimeException for an internal error.

Parameters:
cause - underlying cause
Returns:
an RuntimeException for an internal error


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.