Package org.jfree.chart.util
Class ArrayUtils
- java.lang.Object
-
- org.jfree.chart.util.ArrayUtils
-
public class ArrayUtils extends java.lang.ObjectUtility methods for working with arrays.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateArrayUtils()Private constructor prevents object creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static float[][]clone(float[][] array)Clones a two dimensional array of floats.static intcompareVersionArrays(java.lang.Comparable[] a1, java.lang.Comparable[] a2)Compares the initial elements of two arrays.static booleanequal(float[][] array1, float[][] array2)Tests two float arrays for equality.static booleanequalReferencesInArrays(java.lang.Object[] array1, java.lang.Object[] array2)Returnstrueif all the references inarray1are equal to all the references inarray2(twonullreferences are considered equal for this test).static booleanhasDuplicateItems(java.lang.Object[] array)Returnstrueif any two items in the array are equal to one another.
-
-
-
Method Detail
-
clone
public static float[][] clone(float[][] array)
Clones a two dimensional array of floats.- Parameters:
array- the array.- Returns:
- A clone of the array.
-
equalReferencesInArrays
public static boolean equalReferencesInArrays(java.lang.Object[] array1, java.lang.Object[] array2)Returnstrueif all the references inarray1are equal to all the references inarray2(twonullreferences are considered equal for this test).- Parameters:
array1- the first array (nullpermitted).array2- the second array (nullpermitted).- Returns:
- A boolean.
-
equal
public static boolean equal(float[][] array1, float[][] array2)Tests two float arrays for equality.- Parameters:
array1- the first array (nullpermitted).array2- the second arrray (nullpermitted).- Returns:
- A boolean.
-
hasDuplicateItems
public static boolean hasDuplicateItems(java.lang.Object[] array)
Returnstrueif any two items in the array are equal to one another. Anynullvalues in the array are ignored.- Parameters:
array- the array to check.- Returns:
- A boolean.
-
compareVersionArrays
public static int compareVersionArrays(java.lang.Comparable[] a1, java.lang.Comparable[] a2)Compares the initial elements of two arrays.- Parameters:
a1- array 1.a2- array 2.- Returns:
- An integer showing the relative ordering.
-
-