- java.lang.Object
-
- org.jfree.svg.util.Args
-
public class Args extends java.lang.ObjectA utility class that performs checks for method argument validity.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateArgs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidarrayMustHaveLength(int length, boolean[] array, java.lang.String ref)Checks an array to ensure it has the correct length and throws anIllegalArgumentExceptionif it does not.static voidarrayMustHaveLength(int length, double[] array, java.lang.String ref)Checks an array to ensure it has the correct length and throws anIllegalArgumentExceptionif it does not.static voidnullNotPermitted(java.lang.Object obj, java.lang.String ref)Checks that an argument is non-nulland throws anIllegalArgumentExceptionotherwise.static voidrequireFinitePositive(double d, java.lang.String ref)Checks that an argument is a finite positive value and throws anIllegalArgumentExceptionotherwise.static voidrequireInRange(int value, java.lang.String name, int lowerBound, int upperBound)Checks that the value falls within the specified range and, if it does not, throws anIllegalArgumentException.
-
-
-
Method Detail
-
nullNotPermitted
public static void nullNotPermitted(java.lang.Object obj, java.lang.String ref)Checks that an argument is non-nulland throws anIllegalArgumentExceptionotherwise.- Parameters:
obj- the object to check fornull.ref- the text name for the parameter (to include in the exception message).
-
requireInRange
public static void requireInRange(int value, java.lang.String name, int lowerBound, int upperBound)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
public static void requireFinitePositive(double d, java.lang.String ref)Checks that an argument is a finite positive value and throws anIllegalArgumentExceptionotherwise.- Parameters:
d- the value to check.ref- the text name for the parameter (to include in the exception message).
-
arrayMustHaveLength
public static void arrayMustHaveLength(int length, boolean[] array, java.lang.String ref)Checks an array to ensure it has the correct length and throws anIllegalArgumentExceptionif 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
public static void arrayMustHaveLength(int length, double[] array, java.lang.String ref)Checks an array to ensure it has the correct length and throws anIllegalArgumentExceptionif it does not.- Parameters:
length- the required length.array- the array to check (nullnot permitted).ref- the text name of the array parameter (to include in the exception message).
-
-