org.apache.commons.math.exception

## Class MathIllegalStateException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - java.lang.IllegalStateException
        - - org.apache.commons.math.exception.MathIllegalStateException

All Implemented Interfaces:
  java.io.Serializable, MathThrowable

Direct Known Subclasses:
  ConvergenceException, MathInternalError, NoDataException

    public class MathIllegalStateException
    extends java.lang.IllegalStateException
    implements MathThrowable

Base class for all exceptions that signal a mismatch between the current state and the user's expectations.

Since:
  2.2
Version:
  $Revision: 1061496 $ $Date: 2011-01-20 21:32:16 +0100 (jeu. 20 janv. 2011) $
See Also:
  Serialized Form

### Field Summary

Fields
`private java.lang.Object[]` `arguments` Arguments used to build the message.
`private Localizable` `general` Pattern used to build the message (general problem description).
`private static long` `serialVersionUID` Serializable version Id.
`private Localizable` `specific` Pattern used to build the message (specific context).

### Constructor Summary

Constructors
Constructor and Description
`MathIllegalStateException(Localizable specific, Localizable general, java.lang.Object... args)` Simple constructor.
`MathIllegalStateException(Localizable general, java.lang.Object... args)`
`MathIllegalStateException(java.lang.Throwable cause, Localizable specific, Localizable general, java.lang.Object... args)` Simple constructor.
`MathIllegalStateException(java.lang.Throwable cause, Localizable general, java.lang.Object... args)` Simple constructor.

### Method Summary

Methods
`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)` Get the message in a specified locale.
`Localizable` `getSpecificPattern()` Gets the localizable pattern used to build the specific part of the message of this throwable.

### Methods inherited from class java.lang.Throwable

`fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### serialVersionUID

    private static final long serialVersionUID

Serializable version Id.

See Also:
  Constant Field Values

#### specific

    private final Localizable specific

Pattern used to build the message (specific context).

#### general

    private final Localizable general

Pattern used to build the message (general problem description).

#### arguments

    private final java.lang.Object[] arguments

Arguments used to build the message.

### Constructor Detail

#### MathIllegalStateException

    public MathIllegalStateException(Localizable specific,
                             Localizable general,
                             java.lang.Object... args)

Simple constructor.

Parameters:
  `specific` - Message pattern providing the specific context of the error.
  `general` - Message pattern explaining the cause of the error.
  `args` - Arguments.

#### MathIllegalStateException

    public MathIllegalStateException(java.lang.Throwable cause,
                             Localizable specific,
                             Localizable general,
                             java.lang.Object... args)

Simple constructor.

Parameters:
  `cause` - root cause
  `specific` - Message pattern providing the specific context of the error.
  `general` - Message pattern explaining the cause of the error.
  `args` - Arguments.

#### MathIllegalStateException

    public MathIllegalStateException(Localizable general,
                             java.lang.Object... args)

Parameters:
  `general` - Message pattern explaining the cause of the error.
  `args` - Arguments.

#### MathIllegalStateException

    public MathIllegalStateException(java.lang.Throwable cause,
                             Localizable general,
                             java.lang.Object... args)

Simple constructor.

Parameters:
  `cause` - root cause
  `general` - Message pattern explaining the cause of the error.
  `args` - Arguments.

### Method Detail

#### getSpecificPattern

    public Localizable getSpecificPattern()

Gets the localizable pattern used to build the specific part of the message of this throwable.

Specified by:
  `getSpecificPattern` in interface `MathThrowable`
Returns:
  localizable pattern used to build the specific part of the message of this throwable

#### getGeneralPattern

    public Localizable getGeneralPattern()

Gets the localizable pattern used to build the general part of the message of this throwable.

Specified by:
  `getGeneralPattern` in interface `MathThrowable`
Returns:
  localizable pattern used to build the general part of the message of this throwable

#### getArguments

    public java.lang.Object[] getArguments()

Gets the arguments used to build the message of this throwable.

Specified by:
  `getArguments` in interface `MathThrowable`
Returns:
  the arguments used to build the message of this throwable

#### getMessage

    public java.lang.String getMessage(java.util.Locale locale)

Get the message in a specified locale.

Specified by:
  `getMessage` in interface `MathThrowable`
Parameters:
  `locale` - Locale in which the message should be translated.
Returns:
  the localized message.

#### getMessage

    public java.lang.String getMessage()

Gets the message in a conventional US locale.

Specified by:
  `getMessage` in interface `MathThrowable`
Overrides:
  `getMessage` in class `java.lang.Throwable`
Returns:
  localized message

#### getLocalizedMessage

    public java.lang.String getLocalizedMessage()

Gets the message in the system default locale.

Specified by:
  `getLocalizedMessage` in interface `MathThrowable`
Overrides:
  `getLocalizedMessage` in class `java.lang.Throwable`
Returns:
  localized message