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:
java.io.Serializable
,ExceptionContextProvider
- Direct Known Subclasses:
MatrixDimensionMismatchException
public class MultiDimensionMismatchException extends MathIllegalArgumentException
Exception to be thrown when two sets of dimensions differ.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Integer[]
expected
Correct dimensions.private static long
serialVersionUID
Serializable version Id.private java.lang.Integer[]
wrong
Wrong dimensions.
-
Constructor Summary
Constructors Constructor Description MultiDimensionMismatchException(java.lang.Integer[] wrong, java.lang.Integer[] expected)
Construct an exception from the mismatched dimensions.MultiDimensionMismatchException(Localizable specific, java.lang.Integer[] wrong, java.lang.Integer[] expected)
Construct an exception from the mismatched dimensions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getExpectedDimension(int index)
java.lang.Integer[]
getExpectedDimensions()
int
getWrongDimension(int index)
java.lang.Integer[]
getWrongDimensions()
-
Methods inherited from class org.apache.commons.math3.exception.MathIllegalArgumentException
getContext, getLocalizedMessage, getMessage
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serializable version Id.- See Also:
- Constant Field Values
-
wrong
private final java.lang.Integer[] wrong
Wrong dimensions.
-
expected
private final java.lang.Integer[] expected
Correct dimensions.
-
-
Constructor Detail
-
MultiDimensionMismatchException
public MultiDimensionMismatchException(java.lang.Integer[] wrong, java.lang.Integer[] expected)
Construct an exception from the mismatched dimensions.- Parameters:
wrong
- Wrong dimensions.expected
- Expected dimensions.
-
MultiDimensionMismatchException
public MultiDimensionMismatchException(Localizable specific, java.lang.Integer[] wrong, java.lang.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 java.lang.Integer[] getWrongDimensions()
- Returns:
- an array containing the wrong dimensions.
-
getExpectedDimensions
public java.lang.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
.
-
-