Package com.inductiveautomation.rm.base
Class RMArrayUtils
- java.lang.Object
- 
- com.inductiveautomation.rm.base.RMArrayUtils
 
- 
 public class RMArrayUtils extends java.lang.ObjectA collection of array utility methods.
- 
- 
Constructor SummaryConstructors Constructor Description RMArrayUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T[]add(T[] anArray, T anObj)Adds a value to an array of objects.static <T> T[]add(T[] anArray, T anObj, int anIndex)Returns a new array by adding a value to an array of objects at the given index.static <T> T[]addAll(T[] anArray, T... theObjs)Returns an array by adding to the given array the given objects (array).static <T> T[]addId(T[] anArray, T anObj)Adds a value to an array of objects if list doesn't already contain it.static booleancontains(java.lang.Object[] anArray, java.lang.Object anObj)Returns whether the given array contains the given object.static <T> booleancontainsId(T[] anArray, T aValue)Returns whether the given array contains the identical given object.static int[]copyOfRange(int[] anArray, int from, int to)Returns a copy of given range of given array (this method is in Java 6 Arrays class).static booleanequals(byte[] array1, byte[] array2)Returns whether two byte arrays are equal.static booleanequals(byte[] array1, byte[] array2, int length)Returns whether two byte arrays are equal to the given length.static booleanequals(float[] array1, float[] array2)Returns whether two float arrays are equal.static booleanequals(float[] array1, float[] array2, int length)Returns whether two float arrays are equal to the given length.static <T> T[]get(java.lang.Object[] anArray, java.lang.Class<T> aClass)Returns the individual object of a given class at given index (from all objects of given class).static <T> Tget(java.lang.Object[] anArray, java.lang.Class<T> aClass, int anIndex)Returns the individual object of a given class at given index (from all objects of given class).static intgetCount(java.lang.Object[] anArray, java.lang.Class aClass)Returns the number of object in array of a given class.static intindexOf(java.lang.Object[] anArray, java.lang.Object anObj)Returns the index of the given object in the given array.static <T> intindexOfId(T[] anArray, T aValue)Returns the index of the given object in the given array using "==" instead of equals.static intlength(java.lang.Object[] anArray)Returns the length of a given object array (or zero, if null).static <T> T[]realloc(T[] anArray, int aSize)Creates a new object array with original values and new size.static <T> T[]remove(T[] anArray, int anIndex)Returns a new array by removing a value from an array of objects at the given index.static <T> T[]removeId(T[] anArray, T anObj)Removes a value from an array of objects if list doesn't already contain it.static <T> T[]replace(T[] anArray, int start, int end, T... swapInArray)Replaces a range of values in an int array with values from another int array.static voidreverse(java.lang.Object[] anArray)Reverse and array.
 
- 
- 
- 
Method Detail- 
lengthpublic static int length(java.lang.Object[] anArray) Returns the length of a given object array (or zero, if null).
 - 
addpublic static <T> T[] add(@Nonnull T[] anArray, @Nonnull T anObj)Adds a value to an array of objects.
 - 
addpublic static <T> T[] add(@Nonnull T[] anArray, @Nonnull T anObj, int anIndex)Returns a new array by adding a value to an array of objects at the given index.
 - 
addAllpublic static <T> T[] addAll(T[] anArray, T... theObjs)Returns an array by adding to the given array the given objects (array).
 - 
removepublic static <T> T[] remove(T[] anArray, int anIndex)Returns a new array by removing a value from an array of objects at the given index.
 - 
replacepublic static <T> T[] replace(T[] anArray, int start, int end, T... swapInArray)Replaces a range of values in an int array with values from another int array.
 - 
addIdpublic static <T> T[] addId(T[] anArray, T anObj)Adds a value to an array of objects if list doesn't already contain it.
 - 
removeIdpublic static <T> T[] removeId(T[] anArray, T anObj)Removes a value from an array of objects if list doesn't already contain it.
 - 
getCountpublic static int getCount(java.lang.Object[] anArray, java.lang.Class aClass)Returns the number of object in array of a given class.
 - 
getpublic static <T> T get(java.lang.Object[] anArray, java.lang.Class<T> aClass, int anIndex)Returns the individual object of a given class at given index (from all objects of given class).
 - 
getpublic static <T> T[] get(java.lang.Object[] anArray, java.lang.Class<T> aClass)Returns the individual object of a given class at given index (from all objects of given class).
 - 
reallocpublic static <T> T[] realloc(T[] anArray, int aSize)Creates a new object array with original values and new size.
 - 
equalspublic static boolean equals(byte[] array1, byte[] array2)Returns whether two byte arrays are equal.
 - 
equalspublic static boolean equals(byte[] array1, byte[] array2, int length)Returns whether two byte arrays are equal to the given length.
 - 
equalspublic static boolean equals(float[] array1, float[] array2)Returns whether two float arrays are equal.
 - 
equalspublic static boolean equals(float[] array1, float[] array2, int length)Returns whether two float arrays are equal to the given length.
 - 
indexOfpublic static int indexOf(java.lang.Object[] anArray, java.lang.Object anObj)Returns the index of the given object in the given array.
 - 
containspublic static boolean contains(java.lang.Object[] anArray, java.lang.Object anObj)Returns whether the given array contains the given object.
 - 
indexOfIdpublic static <T> int indexOfId(T[] anArray, T aValue)Returns the index of the given object in the given array using "==" instead of equals.
 - 
containsIdpublic static <T> boolean containsId(T[] anArray, T aValue)Returns whether the given array contains the identical given object.
 - 
copyOfRangepublic static int[] copyOfRange(int[] anArray, int from, int to)Returns a copy of given range of given array (this method is in Java 6 Arrays class).
 - 
reversepublic static void reverse(java.lang.Object[] anArray) Reverse and array.
 
- 
 
-