MultiDimensionMismatchException (Apache Commons Math 3.3 API)

org.apache.commons.math3.exception

## Class MultiDimensionMismatchException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - java.lang.IllegalArgumentException
        - - org.apache.commons.math3.exception.MathIllegalArgumentException
          - - org.apache.commons.math3.exception.MultiDimensionMismatchException

- All Implemented Interfaces:
    Serializable, ExceptionContextProvider
  Direct Known Subclasses:
    MatrixDimensionMismatchException

      public class MultiDimensionMismatchException
      extends MathIllegalArgumentException

  Exception to be thrown when two sets of dimensions differ.
  Since:
    3.0
  Version:
    $Id: MultiDimensionMismatchException.java 1504729 2013-07-18 23:54:52Z sebb $
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiDimensionMismatchException(Integer[] wrong, Integer[] expected)` Construct an exception from the mismatched dimensions.
    `MultiDimensionMismatchException(Localizable specific, Integer[] wrong, Integer[] expected)` Construct an exception from the mismatched dimensions.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getExpectedDimension(int index)`
    `Integer[]` | `getExpectedDimensions()`
    `int` | `getWrongDimension(int index)`
    `Integer[]` | `getWrongDimensions()`

    - ### Methods inherited from class org.apache.commons.math3.exception.MathIllegalArgumentException

      `getContext, getLocalizedMessage, getMessage`

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

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

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

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

- - ### Constructor Detail

    - #### MultiDimensionMismatchException

          public MultiDimensionMismatchException(Integer[] wrong,
                                         Integer[] expected)

      Construct an exception from the mismatched dimensions.
      Parameters:
        `wrong` - Wrong dimensions.
        `expected` - Expected dimensions.

    - #### MultiDimensionMismatchException

          public MultiDimensionMismatchException(Localizable specific,
                                         Integer[] wrong,
                                         Integer[] expected)

      Construct an exception from the mismatched dimensions.
      Parameters:
        `specific` - Message pattern providing the specific context of the error.
        `wrong` - Wrong dimensions.
        `expected` - Expected dimensions.

  - ### Method Detail

    - #### getWrongDimensions

          public Integer[] getWrongDimensions()

      Returns:
        an array containing the wrong dimensions.

    - #### getExpectedDimensions

          public Integer[] getExpectedDimensions()

      Returns:
        an array containing the expected dimensions.

    - #### getWrongDimension

          public int getWrongDimension(int index)

      Parameters:
        `index` - Dimension index.
      Returns:
        the wrong dimension stored at `index`.

    - #### getExpectedDimension

          public int getExpectedDimension(int index)

      Parameters:
        `index` - Dimension index.
      Returns:
        the expected dimension stored at `index`.

Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.