java.lang.Object
org.jfree.svg.util.Args
A utility class that performs checks for method argument validity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
arrayMustHaveLength
(int length, boolean[] array, String ref) Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.static void
arrayMustHaveLength
(int length, double[] array, String ref) Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.static void
nullNotPermitted
(Object obj, String ref) Checks that an argument is non-null
and throws anIllegalArgumentException
otherwise.static void
requireFinitePositive
(double d, String ref) Checks that an argument is a finite positive value and throws anIllegalArgumentException
otherwise.static void
requireInRange
(int value, String name, int lowerBound, int upperBound) Checks that the value falls within the specified range and, if it does not, throws anIllegalArgumentException
.
-
Constructor Details
-
Args
private Args()
-
-
Method Details
-
nullNotPermitted
Checks that an argument is non-null
and throws anIllegalArgumentException
otherwise.- Parameters:
obj
- the object to check fornull
.ref
- the text name for the parameter (to include in the exception message).
-
requireInRange
Checks that the value falls within the specified range and, if it does not, throws anIllegalArgumentException
.- Parameters:
value
- the value.name
- the parameter name.lowerBound
- the lower bound of the permitted range.upperBound
- the upper bound fo the permitted range.
-
requireFinitePositive
Checks that an argument is a finite positive value and throws anIllegalArgumentException
otherwise.- Parameters:
d
- the value to check.ref
- the text name for the parameter (to include in the exception message).
-
arrayMustHaveLength
Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.- Parameters:
length
- the required length.array
- the array to check.ref
- the text name of the array parameter (to include in the exception message).
-
arrayMustHaveLength
Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.- Parameters:
length
- the required length.array
- the array to check (null
not permitted).ref
- the text name of the array parameter (to include in the exception message).
-