org.apache.commons.math
Class MathException

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

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

public class MathException
extends java.lang.Exception

Base class for commons-math checked exceptions.

Supports nesting, emulating JDK 1.4 behavior if necessary.

Adapted from .

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

Constructor Summary
MathException()
          Deprecated. Constructs a new MathException with no detail message.
MathException(Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new MathException with specified formatted detail message.
MathException(java.lang.Throwable rootCause)
          Deprecated. Constructs a new MathException with specified nested Throwable root cause.
MathException(java.lang.Throwable rootCause, Localizable pattern, java.lang.Object... arguments)
          Deprecated. Constructs a new MathException with specified formatted detail message and nested Throwable root cause.
 
Method Summary
 void addMessage(Localizable pat, java.lang.Object... args)
          Deprecated. Sets a 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

MathException

public MathException()
Deprecated. 
Constructs a new MathException with no detail message.


MathException

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

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

MathException

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

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

MathException

public MathException(java.lang.Throwable rootCause,
                     Localizable pattern,
                     java.lang.Object... arguments)
Deprecated. 
Constructs a new MathException 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
Since:
1.2

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


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