public final class ArgChecks extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArrayBounds(int index,
java.lang.String name,
int arrayLimit)
Checks that the index is less than the specified
arrayLimit
and throws an IllegalArgumentException if it is not. |
static void |
finitePositiveRequired(double value,
java.lang.String name)
Checks if the specified argument is finite and positive and,
if it is NOT, throws an
IllegalArgumentException. |
static void |
finiteRequired(double value,
java.lang.String name)
Checks if the specified argument is finite and, if it is NOT, throws an
IllegalArgumentException. |
static void |
negativeNotPermitted(double value,
java.lang.String name)
Checks if the specified argument is negative and, if it is, throws an
IllegalArgumentException. |
static void |
nullNotPermitted(java.lang.Object arg,
java.lang.String name)
Checks if the specified argument is
null and, if it is,
throws an IllegalArgumentException. |
static void |
positiveRequired(double value,
java.lang.String name)
Checks if the specified argument is positive and, if it is NOT, throws an
IllegalArgumentException. |
public static void nullNotPermitted(java.lang.Object arg, java.lang.String name)
null and, if it is,
throws an IllegalArgumentException.arg - the argument to check (null permitted).name - the parameter name (null not permitted).public static void negativeNotPermitted(double value, java.lang.String name)
IllegalArgumentException.value - the value.name - the parameter name (null not permitted).public static void positiveRequired(double value, java.lang.String name)
IllegalArgumentException.value - the value.name - the parameter name (null not permitted).public static void finiteRequired(double value, java.lang.String name)
IllegalArgumentException.value - the value.name - the parameter name (null not permitted).public static void finitePositiveRequired(double value, java.lang.String name)
IllegalArgumentException.value - the value.name - the parameter name (null not permitted).public static void checkArrayBounds(int index, java.lang.String name, int arrayLimit)
arrayLimit
and throws an IllegalArgumentException if it is not.index - the array index.name - the parameter name (to display in the error message).arrayLimit - the array size.