Package org.jfree.util
Class ArrayUtilities
- java.lang.Object
-
- org.jfree.util.ArrayUtilities
-
public class ArrayUtilities extends Object
Utility methods for working with arrays.- Author:
- David Gilbert
-
-
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 int
compareVersionArrays(Comparable[] a1, Comparable[] a2)
Compares the initial elements of two arrays.static boolean
equal(float[][] array1, float[][] array2)
Tests two float arrays for equality.static boolean
equalReferencesInArrays(Object[] array1, Object[] array2)
Returnstrue
if all the references inarray1
are equal to all the references inarray2
(twonull
references are considered equal for this test).static boolean
hasDuplicateItems(Object[] array)
Returnstrue
if 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(Object[] array1, Object[] array2)
Returnstrue
if all the references inarray1
are equal to all the references inarray2
(twonull
references are considered equal for this test).- Parameters:
array1
- the first array (null
permitted).array2
- the second array (null
permitted).- Returns:
- A boolean.
-
equal
public static boolean equal(float[][] array1, float[][] array2)
Tests two float arrays for equality.- Parameters:
array1
- the first array (null
permitted).array2
- the second arrray (null
permitted).- Returns:
- A boolean.
-
hasDuplicateItems
public static boolean hasDuplicateItems(Object[] array)
Returnstrue
if any two items in the array are equal to one another. Anynull
values in the array are ignored.- Parameters:
array
- the array to check.- Returns:
- A boolean.
-
compareVersionArrays
public static int compareVersionArrays(Comparable[] a1, Comparable[] a2)
Compares the initial elements of two arrays.- Parameters:
a1
- array 1.a2
- array 2.- Returns:
- An integer showing the relative ordering.
-
-