Class MathRuntimeException

    • Constructor Detail

      • MathRuntimeException

        public MathRuntimeException​(Localizable pattern,
                                    Object... arguments)
        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​(Throwable rootCause)
        Constructs a new MathRuntimeException with specified nested Throwable root cause.
        Parameters:
        rootCause - the exception or error that caused this exception to be thrown.
      • MathRuntimeException

        @Deprecated
        public MathRuntimeException​(Throwable rootCause,
                                    String pattern,
                                    Object... arguments)
        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
      • MathRuntimeException

        public MathRuntimeException​(Throwable rootCause,
                                    Localizable pattern,
                                    Object... arguments)
        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

      • 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
        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 interface MathThrowable
        Returns:
        localizable pattern used to build the general part of the message of this throwable
        Since:
        2.2
      • getArguments

        public 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 String getMessage​(Locale locale)
        Gets the message in a specified locale.
        Specified by:
        getMessage in interface MathThrowable
        Parameters:
        locale - Locale in which the message should be translated
        Returns:
        localized message
      • printStackTrace

        public void printStackTrace()
        Prints the stack trace of this exception to the standard error stream.
        Overrides:
        printStackTrace in class Throwable
      • printStackTrace

        public void printStackTrace​(PrintStream out)
        Prints the stack trace of this exception to the specified stream.
        Overrides:
        printStackTrace in class Throwable
        Parameters:
        out - the PrintStream to use for output
      • createArithmeticException

        public static ArithmeticException createArithmeticException​(Localizable pattern,
                                                                    Object... arguments)
        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 ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException​(Localizable pattern,
                                                                                          Object... arguments)
        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 EOFException createEOFException​(Localizable pattern,
                                                      Object... arguments)
        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 IOException createIOException​(Throwable rootCause)
        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 IllegalArgumentException createIllegalArgumentException​(Localizable pattern,
                                                                              Object... arguments)
        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 IllegalArgumentException createIllegalArgumentException​(Throwable rootCause)
        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 IllegalStateException createIllegalStateException​(Localizable pattern,
                                                                        Object... arguments)
        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 ConcurrentModificationException createConcurrentModificationException​(Localizable pattern,
                                                                                            Object... arguments)
        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 NoSuchElementException createNoSuchElementException​(Localizable pattern,
                                                                          Object... arguments)
        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
      • createNullPointerException

        @Deprecated
        public static NullPointerException createNullPointerException​(Localizable pattern,
                                                                      Object... arguments)
        Deprecated.
        in 2.2. Checks for "null" must not be performed in Commons-Math.
        Constructs a new NullPointerException 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 ParseException createParseException​(int offset,
                                                          Localizable pattern,
                                                          Object... arguments)
        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