Class ArrayUtils
- java.lang.Object
 - 
- org.apache.commons.lang.ArrayUtils
 
 
- 
@Deprecated(since="2021-04-30") public class ArrayUtils extends java.lang.ObjectDeprecated.Commons Lang 2 is in maintenance mode. Commons Lang 3 should be used instead.Operations on arrays, primitive arrays (like
int[]) and primitive wrapper arrays (likeInteger[]).This class tries to handle
nullinput gracefully. An exception will not be thrown for anullarray input. However, an Object array that contains anullelement may throw an exception. Each method documents its behaviour.#ThreadSafe#
- Since:
 - 2.0
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static boolean[]EMPTY_BOOLEAN_ARRAYDeprecated.An empty immutablebooleanarray.static java.lang.Boolean[]EMPTY_BOOLEAN_OBJECT_ARRAYDeprecated.An empty immutableBooleanarray.static byte[]EMPTY_BYTE_ARRAYDeprecated.An empty immutablebytearray.static java.lang.Byte[]EMPTY_BYTE_OBJECT_ARRAYDeprecated.An empty immutableBytearray.static char[]EMPTY_CHAR_ARRAYDeprecated.An empty immutablechararray.static java.lang.Character[]EMPTY_CHARACTER_OBJECT_ARRAYDeprecated.An empty immutableCharacterarray.static java.lang.Class[]EMPTY_CLASS_ARRAYDeprecated.An empty immutableClassarray.static double[]EMPTY_DOUBLE_ARRAYDeprecated.An empty immutabledoublearray.static java.lang.Double[]EMPTY_DOUBLE_OBJECT_ARRAYDeprecated.An empty immutableDoublearray.static float[]EMPTY_FLOAT_ARRAYDeprecated.An empty immutablefloatarray.static java.lang.Float[]EMPTY_FLOAT_OBJECT_ARRAYDeprecated.An empty immutableFloatarray.static int[]EMPTY_INT_ARRAYDeprecated.An empty immutableintarray.static java.lang.Integer[]EMPTY_INTEGER_OBJECT_ARRAYDeprecated.An empty immutableIntegerarray.static long[]EMPTY_LONG_ARRAYDeprecated.An empty immutablelongarray.static java.lang.Long[]EMPTY_LONG_OBJECT_ARRAYDeprecated.An empty immutableLongarray.static java.lang.Object[]EMPTY_OBJECT_ARRAYDeprecated.An empty immutableObjectarray.static short[]EMPTY_SHORT_ARRAYDeprecated.An empty immutableshortarray.static java.lang.Short[]EMPTY_SHORT_OBJECT_ARRAYDeprecated.An empty immutableShortarray.static java.lang.String[]EMPTY_STRING_ARRAYDeprecated.An empty immutableStringarray.static intINDEX_NOT_FOUNDDeprecated.The index value when an element is not found in a list or array:-1. 
- 
Constructor Summary
Constructors Constructor Description ArrayUtils()Deprecated.ArrayUtils instances should NOT be constructed in standard programming. 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean[]add(boolean[] array, boolean element)Deprecated.Copies the given array and adds the given element at the end of the new array.static boolean[]add(boolean[] array, int index, boolean element)Deprecated.Inserts the specified element at the specified position in the array.static byte[]add(byte[] array, byte element)Deprecated.Copies the given array and adds the given element at the end of the new array.static byte[]add(byte[] array, int index, byte element)Deprecated.Inserts the specified element at the specified position in the array.static char[]add(char[] array, char element)Deprecated.Copies the given array and adds the given element at the end of the new array.static char[]add(char[] array, int index, char element)Deprecated.Inserts the specified element at the specified position in the array.static double[]add(double[] array, double element)Deprecated.Copies the given array and adds the given element at the end of the new array.static double[]add(double[] array, int index, double element)Deprecated.Inserts the specified element at the specified position in the array.static float[]add(float[] array, float element)Deprecated.Copies the given array and adds the given element at the end of the new array.static float[]add(float[] array, int index, float element)Deprecated.Inserts the specified element at the specified position in the array.static int[]add(int[] array, int element)Deprecated.Copies the given array and adds the given element at the end of the new array.static int[]add(int[] array, int index, int element)Deprecated.Inserts the specified element at the specified position in the array.static long[]add(long[] array, int index, long element)Deprecated.Inserts the specified element at the specified position in the array.static long[]add(long[] array, long element)Deprecated.Copies the given array and adds the given element at the end of the new array.static short[]add(short[] array, int index, short element)Deprecated.Inserts the specified element at the specified position in the array.static short[]add(short[] array, short element)Deprecated.Copies the given array and adds the given element at the end of the new array.static java.lang.Object[]add(java.lang.Object[] array, int index, java.lang.Object element)Deprecated.Inserts the specified element at the specified position in the array.static java.lang.Object[]add(java.lang.Object[] array, java.lang.Object element)Deprecated.Copies the given array and adds the given element at the end of the new array.static boolean[]addAll(boolean[] array1, boolean[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static byte[]addAll(byte[] array1, byte[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static char[]addAll(char[] array1, char[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static double[]addAll(double[] array1, double[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static float[]addAll(float[] array1, float[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static int[]addAll(int[] array1, int[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static long[]addAll(long[] array1, long[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static short[]addAll(short[] array1, short[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static java.lang.Object[]addAll(java.lang.Object[] array1, java.lang.Object[] array2)Deprecated.Adds all the elements of the given arrays into a new array.static boolean[]clone(boolean[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static byte[]clone(byte[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static char[]clone(char[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static double[]clone(double[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static float[]clone(float[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static int[]clone(int[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static long[]clone(long[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static short[]clone(short[] array)Deprecated.Clones an array returning a typecast result and handlingnull.static java.lang.Object[]clone(java.lang.Object[] array)Deprecated.Shallow clones an array returning a typecast result and handlingnull.static booleancontains(boolean[] array, boolean valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(byte[] array, byte valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(char[] array, char valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(double[] array, double valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(double[] array, double valueToFind, double tolerance)Deprecated.Checks if a value falling within the given tolerance is in the given array.static booleancontains(float[] array, float valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(int[] array, int valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(long[] array, long valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(short[] array, short valueToFind)Deprecated.Checks if the value is in the given array.static booleancontains(java.lang.Object[] array, java.lang.Object objectToFind)Deprecated.Checks if the object is in the given array.static intgetLength(java.lang.Object array)Deprecated.Returns the length of the specified array.static inthashCode(java.lang.Object array)Deprecated.Get a hashCode for an array handling multi-dimensional arrays correctly.static intindexOf(boolean[] array, boolean valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(boolean[] array, boolean valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(byte[] array, byte valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(byte[] array, byte valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(char[] array, char valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(char[] array, char valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(double[] array, double valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(double[] array, double valueToFind, double tolerance)Deprecated.Finds the index of the given value within a given tolerance in the array.static intindexOf(double[] array, double valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(double[] array, double valueToFind, int startIndex, double tolerance)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(float[] array, float valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(float[] array, float valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(int[] array, int valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(int[] array, int valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(long[] array, long valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(long[] array, long valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(short[] array, short valueToFind)Deprecated.Finds the index of the given value in the array.static intindexOf(short[] array, short valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.static intindexOf(java.lang.Object[] array, java.lang.Object objectToFind)Deprecated.Finds the index of the given object in the array.static intindexOf(java.lang.Object[] array, java.lang.Object objectToFind, int startIndex)Deprecated.Finds the index of the given object in the array starting at the given index.static booleanisEmpty(boolean[] array)Deprecated.Checks if an array of primitive booleans is empty ornull.static booleanisEmpty(byte[] array)Deprecated.Checks if an array of primitive bytes is empty ornull.static booleanisEmpty(char[] array)Deprecated.Checks if an array of primitive chars is empty ornull.static booleanisEmpty(double[] array)Deprecated.Checks if an array of primitive doubles is empty ornull.static booleanisEmpty(float[] array)Deprecated.Checks if an array of primitive floats is empty ornull.static booleanisEmpty(int[] array)Deprecated.Checks if an array of primitive ints is empty ornull.static booleanisEmpty(long[] array)Deprecated.Checks if an array of primitive longs is empty ornull.static booleanisEmpty(short[] array)Deprecated.Checks if an array of primitive shorts is empty ornull.static booleanisEmpty(java.lang.Object[] array)Deprecated.Checks if an array of Objects is empty ornull.static booleanisEquals(java.lang.Object array1, java.lang.Object array2)Deprecated.Compares two arrays, using equals(), handling multi-dimensional arrays correctly.static booleanisNotEmpty(boolean[] array)Deprecated.Checks if an array of primitive booleans is not empty or notnull.static booleanisNotEmpty(byte[] array)Deprecated.Checks if an array of primitive bytes is not empty or notnull.static booleanisNotEmpty(char[] array)Deprecated.Checks if an array of primitive chars is not empty or notnull.static booleanisNotEmpty(double[] array)Deprecated.Checks if an array of primitive doubles is not empty or notnull.static booleanisNotEmpty(float[] array)Deprecated.Checks if an array of primitive floats is not empty or notnull.static booleanisNotEmpty(int[] array)Deprecated.Checks if an array of primitive ints is not empty or notnull.static booleanisNotEmpty(long[] array)Deprecated.Checks if an array of primitive longs is not empty or notnull.static booleanisNotEmpty(short[] array)Deprecated.Checks if an array of primitive shorts is not empty or notnull.static booleanisNotEmpty(java.lang.Object[] array)Deprecated.Checks if an array of Objects is not empty or notnull.static booleanisSameLength(boolean[] array1, boolean[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(byte[] array1, byte[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(char[] array1, char[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(double[] array1, double[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(float[] array1, float[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(int[] array1, int[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(long[] array1, long[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(short[] array1, short[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameLength(java.lang.Object[] array1, java.lang.Object[] array2)Deprecated.Checks whether two arrays are the same length, treatingnullarrays as length0.static booleanisSameType(java.lang.Object array1, java.lang.Object array2)Deprecated.Checks whether two arrays are the same type taking into account multi-dimensional arrays.static intlastIndexOf(boolean[] array, boolean valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(boolean[] array, boolean valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(byte[] array, byte valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(byte[] array, byte valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(char[] array, char valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(char[] array, char valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(double[] array, double valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(double[] array, double valueToFind, double tolerance)Deprecated.Finds the last index of the given value within a given tolerance in the array.static intlastIndexOf(double[] array, double valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(double[] array, double valueToFind, int startIndex, double tolerance)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(float[] array, float valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(float[] array, float valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(int[] array, int valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(int[] array, int valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(long[] array, long valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(long[] array, long valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(short[] array, short valueToFind)Deprecated.Finds the last index of the given value within the array.static intlastIndexOf(short[] array, short valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.static intlastIndexOf(java.lang.Object[] array, java.lang.Object objectToFind)Deprecated.Finds the last index of the given object within the array.static intlastIndexOf(java.lang.Object[] array, java.lang.Object objectToFind, int startIndex)Deprecated.Finds the last index of the given object in the array starting at the given index.static boolean[]nullToEmpty(boolean[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static byte[]nullToEmpty(byte[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static char[]nullToEmpty(char[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static double[]nullToEmpty(double[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static float[]nullToEmpty(float[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static int[]nullToEmpty(int[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static long[]nullToEmpty(long[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static short[]nullToEmpty(short[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Boolean[]nullToEmpty(java.lang.Boolean[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Byte[]nullToEmpty(java.lang.Byte[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Character[]nullToEmpty(java.lang.Character[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Double[]nullToEmpty(java.lang.Double[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Float[]nullToEmpty(java.lang.Float[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Integer[]nullToEmpty(java.lang.Integer[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Long[]nullToEmpty(java.lang.Long[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Object[]nullToEmpty(java.lang.Object[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.Short[]nullToEmpty(java.lang.Short[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static java.lang.String[]nullToEmpty(java.lang.String[] array)Deprecated.Defensive programming technique to change anullreference to an empty one.static boolean[]remove(boolean[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static byte[]remove(byte[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static char[]remove(char[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static double[]remove(double[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static float[]remove(float[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static int[]remove(int[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static long[]remove(long[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static short[]remove(short[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static java.lang.Object[]remove(java.lang.Object[] array, int index)Deprecated.Removes the element at the specified position from the specified array.static boolean[]removeElement(boolean[] array, boolean element)Deprecated.Removes the first occurrence of the specified element from the specified array.static byte[]removeElement(byte[] array, byte element)Deprecated.Removes the first occurrence of the specified element from the specified array.static char[]removeElement(char[] array, char element)Deprecated.Removes the first occurrence of the specified element from the specified array.static double[]removeElement(double[] array, double element)Deprecated.Removes the first occurrence of the specified element from the specified array.static float[]removeElement(float[] array, float element)Deprecated.Removes the first occurrence of the specified element from the specified array.static int[]removeElement(int[] array, int element)Deprecated.Removes the first occurrence of the specified element from the specified array.static long[]removeElement(long[] array, long element)Deprecated.Removes the first occurrence of the specified element from the specified array.static short[]removeElement(short[] array, short element)Deprecated.Removes the first occurrence of the specified element from the specified array.static java.lang.Object[]removeElement(java.lang.Object[] array, java.lang.Object element)Deprecated.Removes the first occurrence of the specified element from the specified array.static voidreverse(boolean[] array)Deprecated.Reverses the order of the given array.static voidreverse(byte[] array)Deprecated.Reverses the order of the given array.static voidreverse(char[] array)Deprecated.Reverses the order of the given array.static voidreverse(double[] array)Deprecated.Reverses the order of the given array.static voidreverse(float[] array)Deprecated.Reverses the order of the given array.static voidreverse(int[] array)Deprecated.Reverses the order of the given array.static voidreverse(long[] array)Deprecated.Reverses the order of the given array.static voidreverse(short[] array)Deprecated.Reverses the order of the given array.static voidreverse(java.lang.Object[] array)Deprecated.Reverses the order of the given array.static boolean[]subarray(boolean[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newbooleanarray containing the elements between the start and end indices.static byte[]subarray(byte[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newbytearray containing the elements between the start and end indices.static char[]subarray(char[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newchararray containing the elements between the start and end indices.static double[]subarray(double[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newdoublearray containing the elements between the start and end indices.static float[]subarray(float[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newfloatarray containing the elements between the start and end indices.static int[]subarray(int[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newintarray containing the elements between the start and end indices.static long[]subarray(long[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newlongarray containing the elements between the start and end indices.static short[]subarray(short[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a newshortarray containing the elements between the start and end indices.static java.lang.Object[]subarray(java.lang.Object[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new array containing the elements between the start and end indices.static java.util.MaptoMap(java.lang.Object[] array)Deprecated.Converts the given array into aMap.static java.lang.Boolean[]toObject(boolean[] array)Deprecated.Converts an array of primitive booleans to objects.static java.lang.Byte[]toObject(byte[] array)Deprecated.Converts an array of primitive bytes to objects.static java.lang.Character[]toObject(char[] array)Deprecated.Converts an array of primitive chars to objects.static java.lang.Double[]toObject(double[] array)Deprecated.Converts an array of primitive doubles to objects.static java.lang.Float[]toObject(float[] array)Deprecated.Converts an array of primitive floats to objects.static java.lang.Integer[]toObject(int[] array)Deprecated.Converts an array of primitive ints to objects.static java.lang.Long[]toObject(long[] array)Deprecated.Converts an array of primitive longs to objects.static java.lang.Short[]toObject(short[] array)Deprecated.Converts an array of primitive shorts to objects.static boolean[]toPrimitive(java.lang.Boolean[] array)Deprecated.Converts an array of object Booleans to primitives.static boolean[]toPrimitive(java.lang.Boolean[] array, boolean valueForNull)Deprecated.Converts an array of object Booleans to primitives handlingnull.static byte[]toPrimitive(java.lang.Byte[] array)Deprecated.Converts an array of object Bytes to primitives.static byte[]toPrimitive(java.lang.Byte[] array, byte valueForNull)Deprecated.Converts an array of object Bytes to primitives handlingnull.static char[]toPrimitive(java.lang.Character[] array)Deprecated.Converts an array of object Characters to primitives.static char[]toPrimitive(java.lang.Character[] array, char valueForNull)Deprecated.Converts an array of object Character to primitives handlingnull.static double[]toPrimitive(java.lang.Double[] array)Deprecated.Converts an array of object Doubles to primitives.static double[]toPrimitive(java.lang.Double[] array, double valueForNull)Deprecated.Converts an array of object Doubles to primitives handlingnull.static float[]toPrimitive(java.lang.Float[] array)Deprecated.Converts an array of object Floats to primitives.static float[]toPrimitive(java.lang.Float[] array, float valueForNull)Deprecated.Converts an array of object Floats to primitives handlingnull.static int[]toPrimitive(java.lang.Integer[] array)Deprecated.Converts an array of object Integers to primitives.static int[]toPrimitive(java.lang.Integer[] array, int valueForNull)Deprecated.Converts an array of object Integer to primitives handlingnull.static long[]toPrimitive(java.lang.Long[] array)Deprecated.Converts an array of object Longs to primitives.static long[]toPrimitive(java.lang.Long[] array, long valueForNull)Deprecated.Converts an array of object Long to primitives handlingnull.static short[]toPrimitive(java.lang.Short[] array)Deprecated.Converts an array of object Shorts to primitives.static short[]toPrimitive(java.lang.Short[] array, short valueForNull)Deprecated.Converts an array of object Short to primitives handlingnull.static java.lang.StringtoString(java.lang.Object array)Deprecated.Outputs an array as a String, treatingnullas an empty array.static java.lang.StringtoString(java.lang.Object array, java.lang.String stringIfNull)Deprecated.Outputs an array as a String handlingnulls. 
 - 
 
- 
- 
Field Detail
- 
EMPTY_OBJECT_ARRAY
public static final java.lang.Object[] EMPTY_OBJECT_ARRAY
Deprecated.An empty immutableObjectarray. 
- 
EMPTY_CLASS_ARRAY
public static final java.lang.Class[] EMPTY_CLASS_ARRAY
Deprecated.An empty immutableClassarray. 
- 
EMPTY_STRING_ARRAY
public static final java.lang.String[] EMPTY_STRING_ARRAY
Deprecated.An empty immutableStringarray. 
- 
EMPTY_LONG_ARRAY
public static final long[] EMPTY_LONG_ARRAY
Deprecated.An empty immutablelongarray. 
- 
EMPTY_LONG_OBJECT_ARRAY
public static final java.lang.Long[] EMPTY_LONG_OBJECT_ARRAY
Deprecated.An empty immutableLongarray. 
- 
EMPTY_INT_ARRAY
public static final int[] EMPTY_INT_ARRAY
Deprecated.An empty immutableintarray. 
- 
EMPTY_INTEGER_OBJECT_ARRAY
public static final java.lang.Integer[] EMPTY_INTEGER_OBJECT_ARRAY
Deprecated.An empty immutableIntegerarray. 
- 
EMPTY_SHORT_ARRAY
public static final short[] EMPTY_SHORT_ARRAY
Deprecated.An empty immutableshortarray. 
- 
EMPTY_SHORT_OBJECT_ARRAY
public static final java.lang.Short[] EMPTY_SHORT_OBJECT_ARRAY
Deprecated.An empty immutableShortarray. 
- 
EMPTY_BYTE_ARRAY
public static final byte[] EMPTY_BYTE_ARRAY
Deprecated.An empty immutablebytearray. 
- 
EMPTY_BYTE_OBJECT_ARRAY
public static final java.lang.Byte[] EMPTY_BYTE_OBJECT_ARRAY
Deprecated.An empty immutableBytearray. 
- 
EMPTY_DOUBLE_ARRAY
public static final double[] EMPTY_DOUBLE_ARRAY
Deprecated.An empty immutabledoublearray. 
- 
EMPTY_DOUBLE_OBJECT_ARRAY
public static final java.lang.Double[] EMPTY_DOUBLE_OBJECT_ARRAY
Deprecated.An empty immutableDoublearray. 
- 
EMPTY_FLOAT_ARRAY
public static final float[] EMPTY_FLOAT_ARRAY
Deprecated.An empty immutablefloatarray. 
- 
EMPTY_FLOAT_OBJECT_ARRAY
public static final java.lang.Float[] EMPTY_FLOAT_OBJECT_ARRAY
Deprecated.An empty immutableFloatarray. 
- 
EMPTY_BOOLEAN_ARRAY
public static final boolean[] EMPTY_BOOLEAN_ARRAY
Deprecated.An empty immutablebooleanarray. 
- 
EMPTY_BOOLEAN_OBJECT_ARRAY
public static final java.lang.Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY
Deprecated.An empty immutableBooleanarray. 
- 
EMPTY_CHAR_ARRAY
public static final char[] EMPTY_CHAR_ARRAY
Deprecated.An empty immutablechararray. 
- 
EMPTY_CHARACTER_OBJECT_ARRAY
public static final java.lang.Character[] EMPTY_CHARACTER_OBJECT_ARRAY
Deprecated.An empty immutableCharacterarray. 
- 
INDEX_NOT_FOUND
public static final int INDEX_NOT_FOUND
Deprecated.The index value when an element is not found in a list or array:-1. This value is returned by methods in this class and can also be used in comparisons with values returned by various method fromList.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
toString
public static java.lang.String toString(java.lang.Object array)
Deprecated.Outputs an array as a String, treating
nullas an empty array.Multi-dimensional arrays are handled correctly, including multi-dimensional primitive arrays.
The format is that of Java source code, for example
{a,b}.- Parameters:
 array- the array to get a toString for, may benull- Returns:
 - a String representation of the array, '{}' if null array input
 
 
- 
toString
public static java.lang.String toString(java.lang.Object array, java.lang.String stringIfNull)Deprecated.Outputs an array as a String handling
nulls.Multi-dimensional arrays are handled correctly, including multi-dimensional primitive arrays.
The format is that of Java source code, for example
{a,b}.- Parameters:
 array- the array to get a toString for, may benullstringIfNull- the String to return if the array isnull- Returns:
 - a String representation of the array
 
 
- 
hashCode
public static int hashCode(java.lang.Object array)
Deprecated.Get a hashCode for an array handling multi-dimensional arrays correctly.
Multi-dimensional primitive arrays are also handled correctly by this method.
- Parameters:
 array- the array to get a hashCode for, may benull- Returns:
 - a hashCode for the array, zero if null array input
 
 
- 
isEquals
public static boolean isEquals(java.lang.Object array1, java.lang.Object array2)Deprecated.Compares two arrays, using equals(), handling multi-dimensional arrays correctly.
Multi-dimensional primitive arrays are also handled correctly by this method.
- Parameters:
 array1- the left hand array to compare, may benullarray2- the right hand array to compare, may benull- Returns:
 trueif the arrays are equal
 
- 
toMap
public static java.util.Map toMap(java.lang.Object[] array)
Deprecated.Converts the given array into a
Map. Each element of the array must be either aMap.Entryor an Array, containing at least two elements, where the first element is used as key and the second as value.This method can be used to initialize:
// Create a Map mapping colors. Map colorMap = MapUtils.toMap(new String[][] {{ {"RED", "#FF0000"}, {"GREEN", "#00FF00"}, {"BLUE", "#0000FF"}});This method returns
nullfor anullinput array.- Parameters:
 array- an array whose elements are either aMap.Entryor an Array containing at least two elements, may benull- Returns:
 - a 
Mapthat was created from the array - Throws:
 java.lang.IllegalArgumentException- if one element of this Array is itself an Array containing less then two elementsjava.lang.IllegalArgumentException- if the array contains elements other thanMap.Entryand an Array
 
- 
clone
public static java.lang.Object[] clone(java.lang.Object[] array)
Deprecated.Shallow clones an array returning a typecast result and handling
null.The objects in the array are not cloned, thus there is no special handling for multi-dimensional arrays.
This method returns
nullfor anullinput array.- Parameters:
 array- the array to shallow clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static long[] clone(long[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static int[] clone(int[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static short[] clone(short[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static char[] clone(char[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static byte[] clone(byte[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static double[] clone(double[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static float[] clone(float[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
clone
public static boolean[] clone(boolean[] array)
Deprecated.Clones an array returning a typecast result and handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- the array to clone, may benull- Returns:
 - the cloned array, 
nullifnullinput 
 
- 
nullToEmpty
public static java.lang.Object[] nullToEmpty(java.lang.Object[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.String[] nullToEmpty(java.lang.String[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static long[] nullToEmpty(long[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static int[] nullToEmpty(int[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static short[] nullToEmpty(short[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static char[] nullToEmpty(char[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static byte[] nullToEmpty(byte[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static double[] nullToEmpty(double[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static float[] nullToEmpty(float[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static boolean[] nullToEmpty(boolean[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Long[] nullToEmpty(java.lang.Long[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Integer[] nullToEmpty(java.lang.Integer[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Short[] nullToEmpty(java.lang.Short[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Character[] nullToEmpty(java.lang.Character[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Byte[] nullToEmpty(java.lang.Byte[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Double[] nullToEmpty(java.lang.Double[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Float[] nullToEmpty(java.lang.Float[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
nullToEmpty
public static java.lang.Boolean[] nullToEmpty(java.lang.Boolean[] array)
Deprecated.Defensive programming technique to change a
nullreference to an empty one.This method returns an empty array for a
nullinput array.As a memory optimizing technique an empty array passed in will be overridden with the empty
public staticreferences in this class.- Parameters:
 array- the array to check fornullor empty- Returns:
 - the same array, 
public staticempty array ifnullor empty input - Since:
 - 2.5
 
 
- 
subarray
public static java.lang.Object[] subarray(java.lang.Object[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new array containing the elements between the start and end indices.
The start index is inclusive, the end index exclusive. Null array input produces null output.
The component type of the subarray is always the same as that of the input array. Thus, if the input is an array of type
Date, the following usage is envisaged:Date[] someDates = (Date[])ArrayUtils.subarray(allDates, 2, 5);
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static long[] subarray(long[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
longarray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static int[] subarray(int[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
intarray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static short[] subarray(short[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
shortarray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static char[] subarray(char[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
chararray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static byte[] subarray(byte[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
bytearray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static double[] subarray(double[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
doublearray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static float[] subarray(float[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
floatarray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
subarray
public static boolean[] subarray(boolean[] array, int startIndexInclusive, int endIndexExclusive)Deprecated.Produces a new
booleanarray containing the elements between the start and end indices.The start index is inclusive, the end index exclusive. Null array input produces null output.
- Parameters:
 array- the arraystartIndexInclusive- the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in an empty array.endIndexExclusive- elements up to endIndex-1 are present in the returned subarray. Undervalue (< startIndex) produces empty array, overvalue (>array.length) is demoted to array length.- Returns:
 - a new array containing the elements between the start and end indices.
 - Since:
 - 2.1
 
 
- 
isSameLength
public static boolean isSameLength(java.lang.Object[] array1, java.lang.Object[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.Any multi-dimensional aspects of the arrays are ignored.
- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(long[] array1, long[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(int[] array1, int[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(short[] array1, short[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(char[] array1, char[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(byte[] array1, byte[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(double[] array1, double[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(float[] array1, float[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
isSameLength
public static boolean isSameLength(boolean[] array1, boolean[] array2)Deprecated.Checks whether two arrays are the same length, treating
nullarrays as length0.- Parameters:
 array1- the first array, may benullarray2- the second array, may benull- Returns:
 trueif length of arrays matches, treatingnullas an empty array
 
- 
getLength
public static int getLength(java.lang.Object array)
Deprecated.Returns the length of the specified array. This method can deal with
Objectarrays and with primitive arrays.If the input array is
null,0is returned.ArrayUtils.getLength(null) = 0 ArrayUtils.getLength([]) = 0 ArrayUtils.getLength([null]) = 1 ArrayUtils.getLength([true, false]) = 2 ArrayUtils.getLength([1, 2, 3]) = 3 ArrayUtils.getLength(["a", "b", "c"]) = 3
- Parameters:
 array- the array to retrieve the length from, may be null- Returns:
 - The length of the array, or 
0if the array isnull - Throws:
 java.lang.IllegalArgumentException- if the object arguement is not an array.- Since:
 - 2.1
 
 
- 
isSameType
public static boolean isSameType(java.lang.Object array1, java.lang.Object array2)Deprecated.Checks whether two arrays are the same type taking into account multi-dimensional arrays.
- Parameters:
 array1- the first array, must not benullarray2- the second array, must not benull- Returns:
 trueif type of arrays matches- Throws:
 java.lang.IllegalArgumentException- if either array isnull
 
- 
reverse
public static void reverse(java.lang.Object[] array)
Deprecated.Reverses the order of the given array.
There is no special handling for multi-dimensional arrays.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(long[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(int[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(short[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(char[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(byte[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(double[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(float[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
reverse
public static void reverse(boolean[] array)
Deprecated.Reverses the order of the given array.
This method does nothing for a
nullinput array.- Parameters:
 array- the array to reverse, may benull
 
- 
indexOf
public static int indexOf(java.lang.Object[] array, java.lang.Object objectToFind)Deprecated.Finds the index of the given object in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullobjectToFind- the object to find, may benull- Returns:
 - the index of the object within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(java.lang.Object[] array, java.lang.Object objectToFind, int startIndex)Deprecated.Finds the index of the given object in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullobjectToFind- the object to find, may benullstartIndex- the index to start searching at- Returns:
 - the index of the object within the array starting at the index,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(java.lang.Object[] array, java.lang.Object objectToFind)Deprecated.Finds the last index of the given object within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullobjectToFind- the object to find, may benull- Returns:
 - the last index of the object within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(java.lang.Object[] array, java.lang.Object objectToFind, int startIndex)Deprecated.Finds the last index of the given object in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullobjectToFind- the object to find, may benullstartIndex- the start index to travers backwards from- Returns:
 - the last index of the object within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(java.lang.Object[] array, java.lang.Object objectToFind)Deprecated.Checks if the object is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughobjectToFind- the object to find- Returns:
 trueif the array contains the object
 
- 
indexOf
public static int indexOf(long[] array, long valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(long[] array, long valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(long[] array, long valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(long[] array, long valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(long[] array, long valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
indexOf
public static int indexOf(int[] array, int valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(int[] array, int valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(int[] array, int valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(int[] array, int valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(int[] array, int valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
indexOf
public static int indexOf(short[] array, short valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(short[] array, short valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(short[] array, short valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(short[] array, short valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(short[] array, short valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
indexOf
public static int indexOf(char[] array, char valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input - Since:
 - 2.1
 
 
- 
indexOf
public static int indexOf(char[] array, char valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input - Since:
 - 2.1
 
 
- 
lastIndexOf
public static int lastIndexOf(char[] array, char valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input - Since:
 - 2.1
 
 
- 
lastIndexOf
public static int lastIndexOf(char[] array, char valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input - Since:
 - 2.1
 
 
- 
contains
public static boolean contains(char[] array, char valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object- Since:
 - 2.1
 
 
- 
indexOf
public static int indexOf(byte[] array, byte valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(byte[] array, byte valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(byte[] array, byte valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(byte[] array, byte valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(byte[] array, byte valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
indexOf
public static int indexOf(double[] array, double valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(double[] array, double valueToFind, double tolerance)Deprecated.Finds the index of the given value within a given tolerance in the array. This method will return the index of the first value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findtolerance- tolerance of the search- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(double[] array, double valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(double[] array, double valueToFind, int startIndex, double tolerance)Deprecated.Finds the index of the given value in the array starting at the given index. This method will return the index of the first value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching attolerance- tolerance of the search- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(double[] array, double valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(double[] array, double valueToFind, double tolerance)Deprecated.Finds the last index of the given value within a given tolerance in the array. This method will return the index of the last value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findtolerance- tolerance of the search- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(double[] array, double valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(double[] array, double valueToFind, int startIndex, double tolerance)Deprecated.Finds the last index of the given value in the array starting at the given index. This method will return the index of the last value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards fromtolerance- search for value within plus/minus this amount- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(double[] array, double valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
contains
public static boolean contains(double[] array, double valueToFind, double tolerance)Deprecated.Checks if a value falling within the given tolerance is in the given array. If the array contains a value within the inclusive range defined by (value - tolerance) to (value + tolerance).
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to searchvalueToFind- the value to findtolerance- the array contains the tolerance of the search- Returns:
 - true if value falling within tolerance is in array
 
 
- 
indexOf
public static int indexOf(float[] array, float valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(float[] array, float valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(float[] array, float valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(float[] array, float valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(float[] array, float valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
indexOf
public static int indexOf(boolean[] array, boolean valueToFind)Deprecated.Finds the index of the given value in the array.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to find- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
indexOf
public static int indexOf(boolean[] array, boolean valueToFind, int startIndex)Deprecated.Finds the index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex is treated as zero. A startIndex larger than the array length will return
INDEX_NOT_FOUND(-1).- Parameters:
 array- the array to search through for the object, may benullvalueToFind- the value to findstartIndex- the index to start searching at- Returns:
 - the index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(boolean[] array, boolean valueToFind)Deprecated.Finds the last index of the given value within the array.
This method returns
INDEX_NOT_FOUND(-1) ifnullarray input.- Parameters:
 array- the array to travers backwords looking for the object, may benullvalueToFind- the object to find- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
lastIndexOf
public static int lastIndexOf(boolean[] array, boolean valueToFind, int startIndex)Deprecated.Finds the last index of the given value in the array starting at the given index.
This method returns
INDEX_NOT_FOUND(-1) for anullinput array.A negative startIndex will return
INDEX_NOT_FOUND(-1). A startIndex larger than the array length will search from the end of the array.- Parameters:
 array- the array to traverse for looking for the object, may benullvalueToFind- the value to findstartIndex- the start index to travers backwards from- Returns:
 - the last index of the value within the array,
  
INDEX_NOT_FOUND(-1) if not found ornullarray input 
 
- 
contains
public static boolean contains(boolean[] array, boolean valueToFind)Deprecated.Checks if the value is in the given array.
The method returns
falseif anullarray is passed in.- Parameters:
 array- the array to search throughvalueToFind- the value to find- Returns:
 trueif the array contains the object
 
- 
toPrimitive
public static char[] toPrimitive(java.lang.Character[] array)
Deprecated.Converts an array of object Characters to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aCharacterarray, may benull- Returns:
 - a 
chararray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static char[] toPrimitive(java.lang.Character[] array, char valueForNull)Deprecated.Converts an array of object Character to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aCharacterarray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
chararray,nullif null array input 
 
- 
toObject
public static java.lang.Character[] toObject(char[] array)
Deprecated.Converts an array of primitive chars to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- achararray- Returns:
 - a 
Characterarray,nullif null array input 
 
- 
toPrimitive
public static long[] toPrimitive(java.lang.Long[] array)
Deprecated.Converts an array of object Longs to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aLongarray, may benull- Returns:
 - a 
longarray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static long[] toPrimitive(java.lang.Long[] array, long valueForNull)Deprecated.Converts an array of object Long to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aLongarray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
longarray,nullif null array input 
 
- 
toObject
public static java.lang.Long[] toObject(long[] array)
Deprecated.Converts an array of primitive longs to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- alongarray- Returns:
 - a 
Longarray,nullif null array input 
 
- 
toPrimitive
public static int[] toPrimitive(java.lang.Integer[] array)
Deprecated.Converts an array of object Integers to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aIntegerarray, may benull- Returns:
 - an 
intarray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static int[] toPrimitive(java.lang.Integer[] array, int valueForNull)Deprecated.Converts an array of object Integer to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aIntegerarray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - an 
intarray,nullif null array input 
 
- 
toObject
public static java.lang.Integer[] toObject(int[] array)
Deprecated.Converts an array of primitive ints to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- anintarray- Returns:
 - an 
Integerarray,nullif null array input 
 
- 
toPrimitive
public static short[] toPrimitive(java.lang.Short[] array)
Deprecated.Converts an array of object Shorts to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aShortarray, may benull- Returns:
 - a 
bytearray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static short[] toPrimitive(java.lang.Short[] array, short valueForNull)Deprecated.Converts an array of object Short to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aShortarray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
bytearray,nullif null array input 
 
- 
toObject
public static java.lang.Short[] toObject(short[] array)
Deprecated.Converts an array of primitive shorts to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- ashortarray- Returns:
 - a 
Shortarray,nullif null array input 
 
- 
toPrimitive
public static byte[] toPrimitive(java.lang.Byte[] array)
Deprecated.Converts an array of object Bytes to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aBytearray, may benull- Returns:
 - a 
bytearray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static byte[] toPrimitive(java.lang.Byte[] array, byte valueForNull)Deprecated.Converts an array of object Bytes to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aBytearray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
bytearray,nullif null array input 
 
- 
toObject
public static java.lang.Byte[] toObject(byte[] array)
Deprecated.Converts an array of primitive bytes to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- abytearray- Returns:
 - a 
Bytearray,nullif null array input 
 
- 
toPrimitive
public static double[] toPrimitive(java.lang.Double[] array)
Deprecated.Converts an array of object Doubles to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aDoublearray, may benull- Returns:
 - a 
doublearray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static double[] toPrimitive(java.lang.Double[] array, double valueForNull)Deprecated.Converts an array of object Doubles to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aDoublearray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
doublearray,nullif null array input 
 
- 
toObject
public static java.lang.Double[] toObject(double[] array)
Deprecated.Converts an array of primitive doubles to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- adoublearray- Returns:
 - a 
Doublearray,nullif null array input 
 
- 
toPrimitive
public static float[] toPrimitive(java.lang.Float[] array)
Deprecated.Converts an array of object Floats to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aFloatarray, may benull- Returns:
 - a 
floatarray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static float[] toPrimitive(java.lang.Float[] array, float valueForNull)Deprecated.Converts an array of object Floats to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aFloatarray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
floatarray,nullif null array input 
 
- 
toObject
public static java.lang.Float[] toObject(float[] array)
Deprecated.Converts an array of primitive floats to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- afloatarray- Returns:
 - a 
Floatarray,nullif null array input 
 
- 
toPrimitive
public static boolean[] toPrimitive(java.lang.Boolean[] array)
Deprecated.Converts an array of object Booleans to primitives.
This method returns
nullfor anullinput array.- Parameters:
 array- aBooleanarray, may benull- Returns:
 - a 
booleanarray,nullif null array input - Throws:
 java.lang.NullPointerException- if array content isnull
 
- 
toPrimitive
public static boolean[] toPrimitive(java.lang.Boolean[] array, boolean valueForNull)Deprecated.Converts an array of object Booleans to primitives handling
null.This method returns
nullfor anullinput array.- Parameters:
 array- aBooleanarray, may benullvalueForNull- the value to insert ifnullfound- Returns:
 - a 
booleanarray,nullif null array input 
 
- 
toObject
public static java.lang.Boolean[] toObject(boolean[] array)
Deprecated.Converts an array of primitive booleans to objects.
This method returns
nullfor anullinput array.- Parameters:
 array- abooleanarray- Returns:
 - a 
Booleanarray,nullif null array input 
 
- 
isEmpty
public static boolean isEmpty(java.lang.Object[] array)
Deprecated.Checks if an array of Objects is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(long[] array)
Deprecated.Checks if an array of primitive longs is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(int[] array)
Deprecated.Checks if an array of primitive ints is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(short[] array)
Deprecated.Checks if an array of primitive shorts is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(char[] array)
Deprecated.Checks if an array of primitive chars is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(byte[] array)
Deprecated.Checks if an array of primitive bytes is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(double[] array)
Deprecated.Checks if an array of primitive doubles is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(float[] array)
Deprecated.Checks if an array of primitive floats is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isEmpty
public static boolean isEmpty(boolean[] array)
Deprecated.Checks if an array of primitive booleans is empty or
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is empty ornull- Since:
 - 2.1
 
 
- 
isNotEmpty
public static boolean isNotEmpty(java.lang.Object[] array)
Deprecated.Checks if an array of Objects is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(long[] array)
Deprecated.Checks if an array of primitive longs is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(int[] array)
Deprecated.Checks if an array of primitive ints is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(short[] array)
Deprecated.Checks if an array of primitive shorts is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(char[] array)
Deprecated.Checks if an array of primitive chars is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(byte[] array)
Deprecated.Checks if an array of primitive bytes is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(double[] array)
Deprecated.Checks if an array of primitive doubles is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(float[] array)
Deprecated.Checks if an array of primitive floats is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
isNotEmpty
public static boolean isNotEmpty(boolean[] array)
Deprecated.Checks if an array of primitive booleans is not empty or not
null.- Parameters:
 array- the array to test- Returns:
 trueif the array is not empty or notnull- Since:
 - 2.5
 
 
- 
addAll
public static java.lang.Object[] addAll(java.lang.Object[] array1, java.lang.Object[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(null, null) = null ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = [] ArrayUtils.addAll([null], [null]) = [null, null] ArrayUtils.addAll(["a", "b", "c"], ["1", "2", "3"]) = ["a", "b", "c", "1", "2", "3"]
- Parameters:
 array1- the first array whose elements are added to the new array, may benullarray2- the second array whose elements are added to the new array, may benull- Returns:
 - The new array, 
nullif both arrays arenull. The type of the new array is the type of the first array, unless the first array is null, in which case the type is the same as the second array. - Throws:
 java.lang.IllegalArgumentException- if the array types are incompatible- Since:
 - 2.1
 
 
- 
addAll
public static boolean[] addAll(boolean[] array1, boolean[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new boolean[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static char[] addAll(char[] array1, char[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new char[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static byte[] addAll(byte[] array1, byte[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new byte[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static short[] addAll(short[] array1, short[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new short[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static int[] addAll(int[] array1, int[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new int[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static long[] addAll(long[] array1, long[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new long[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static float[] addAll(float[] array1, float[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new float[] array.
 - Since:
 - 2.1
 
 
- 
addAll
public static double[] addAll(double[] array1, double[] array2)Deprecated.Adds all the elements of the given arrays into a new array.
The new array contains all of the element of
array1followed by all of the elementsarray2. When an array is returned, it is always a new array.ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
- Parameters:
 array1- the first array whose elements are added to the new array.array2- the second array whose elements are added to the new array.- Returns:
 - The new double[] array.
 - Since:
 - 2.1
 
 
- 
add
public static java.lang.Object[] add(java.lang.Object[] array, java.lang.Object element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element, unless the element itself is null, in which case the return type is Object[]ArrayUtils.add(null, null) = [null] ArrayUtils.add(null, "a") = ["a"] ArrayUtils.add(["a"], null) = ["a", null] ArrayUtils.add(["a"], "b") = ["a", "b"] ArrayUtils.add(["a", "b"], "c") = ["a", "b", "c"]
- Parameters:
 array- the array to "add" the element to, may benullelement- the object to add, may benull- Returns:
 - A new array containing the existing elements plus the new element The returned array type will be that of the input array (unless null), in which case it will have the same type as the element.
 - Since:
 - 2.1
 
 
- 
add
public static boolean[] add(boolean[] array, boolean element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, true) = [true] ArrayUtils.add([true], false) = [true, false] ArrayUtils.add([true, false], true) = [true, false, true]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static byte[] add(byte[] array, byte element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static char[] add(char[] array, char element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, '0') = ['0'] ArrayUtils.add(['1'], '0') = ['1', '0'] ArrayUtils.add(['1', '0'], '1') = ['1', '0', '1']
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static double[] add(double[] array, double element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static float[] add(float[] array, float element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static int[] add(int[] array, int element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static long[] add(long[] array, long element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static short[] add(short[] array, short element)Deprecated.Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
- Parameters:
 array- the array to copy and add the element to, may benullelement- the object to add at the last index of the new array- Returns:
 - A new array containing the existing elements plus the new element
 - Since:
 - 2.1
 
 
- 
add
public static java.lang.Object[] add(java.lang.Object[] array, int index, java.lang.Object element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0, null) = [null] ArrayUtils.add(null, 0, "a") = ["a"] ArrayUtils.add(["a"], 1, null) = ["a", null] ArrayUtils.add(["a"], 1, "b") = ["a", "b"] ArrayUtils.add(["a", "b"], 3, "c") = ["a", "b", "c"]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static boolean[] add(boolean[] array, int index, boolean element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0, true) = [true] ArrayUtils.add([true], 0, false) = [false, true] ArrayUtils.add([false], 1, true) = [false, true] ArrayUtils.add([true, false], 1, true) = [true, true, false]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static char[] add(char[] array, int index, char element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add(null, 0, 'a') = ['a'] ArrayUtils.add(['a'], 0, 'b') = ['b', 'a'] ArrayUtils.add(['a', 'b'], 0, 'c') = ['c', 'a', 'b'] ArrayUtils.add(['a', 'b'], 1, 'k') = ['a', 'k', 'b'] ArrayUtils.add(['a', 'b', 'c'], 1, 't') = ['a', 't', 'b', 'c']
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static byte[] add(byte[] array, int index, byte element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add([1], 0, 2) = [2, 1] ArrayUtils.add([2, 6], 2, 3) = [2, 6, 3] ArrayUtils.add([2, 6], 0, 1) = [1, 2, 6] ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static short[] add(short[] array, int index, short element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add([1], 0, 2) = [2, 1] ArrayUtils.add([2, 6], 2, 10) = [2, 6, 10] ArrayUtils.add([2, 6], 0, -4) = [-4, 2, 6] ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static int[] add(int[] array, int index, int element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add([1], 0, 2) = [2, 1] ArrayUtils.add([2, 6], 2, 10) = [2, 6, 10] ArrayUtils.add([2, 6], 0, -4) = [-4, 2, 6] ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static long[] add(long[] array, int index, long element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add([1L], 0, 2L) = [2L, 1L] ArrayUtils.add([2L, 6L], 2, 10L) = [2L, 6L, 10L] ArrayUtils.add([2L, 6L], 0, -4L) = [-4L, 2L, 6L] ArrayUtils.add([2L, 6L, 3L], 2, 1L) = [2L, 6L, 1L, 3L]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static float[] add(float[] array, int index, float element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add([1.1f], 0, 2.2f) = [2.2f, 1.1f] ArrayUtils.add([2.3f, 6.4f], 2, 10.5f) = [2.3f, 6.4f, 10.5f] ArrayUtils.add([2.6f, 6.7f], 0, -4.8f) = [-4.8f, 2.6f, 6.7f] ArrayUtils.add([2.9f, 6.0f, 0.3f], 2, 1.0f) = [2.9f, 6.0f, 1.0f, 0.3f]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
add
public static double[] add(double[] array, int index, double element)Deprecated.Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, a new one element array is returned whose component type is the same as the element.ArrayUtils.add([1.1], 0, 2.2) = [2.2, 1.1] ArrayUtils.add([2.3, 6.4], 2, 10.5) = [2.3, 6.4, 10.5] ArrayUtils.add([2.6, 6.7], 0, -4.8) = [-4.8, 2.6, 6.7] ArrayUtils.add([2.9, 6.0, 0.3], 2, 1.0) = [2.9, 6.0, 1.0, 0.3]
- Parameters:
 array- the array to add the element to, may benullindex- the position of the new objectelement- the object to add- Returns:
 - A new array containing the existing elements and the new element
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index > array.length).
 
- 
remove
public static java.lang.Object[] remove(java.lang.Object[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove(["a"], 0) = [] ArrayUtils.remove(["a", "b"], 0) = ["b"] ArrayUtils.remove(["a", "b"], 1) = ["a"] ArrayUtils.remove(["a", "b", "c"], 1) = ["a", "c"]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static java.lang.Object[] removeElement(java.lang.Object[] array, java.lang.Object element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, "a") = null ArrayUtils.removeElement([], "a") = [] ArrayUtils.removeElement(["a"], "b") = ["a"] ArrayUtils.removeElement(["a", "b"], "a") = ["b"] ArrayUtils.removeElement(["a", "b", "a"], "a") = ["b", "a"]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static boolean[] remove(boolean[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([true], 0) = [] ArrayUtils.remove([true, false], 0) = [false] ArrayUtils.remove([true, false], 1) = [true] ArrayUtils.remove([true, true, false], 1) = [true, false]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static boolean[] removeElement(boolean[] array, boolean element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, true) = null ArrayUtils.removeElement([], true) = [] ArrayUtils.removeElement([true], false) = [true] ArrayUtils.removeElement([true, false], false) = [true] ArrayUtils.removeElement([true, false, true], true) = [false, true]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static byte[] remove(byte[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([1, 0], 0) = [0] ArrayUtils.remove([1, 0], 1) = [1] ArrayUtils.remove([1, 0, 1], 1) = [1, 1]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static byte[] removeElement(byte[] array, byte element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 0) = [1] ArrayUtils.removeElement([1, 0], 0) = [1] ArrayUtils.removeElement([1, 0, 1], 1) = [0, 1]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static char[] remove(char[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove(['a'], 0) = [] ArrayUtils.remove(['a', 'b'], 0) = ['b'] ArrayUtils.remove(['a', 'b'], 1) = ['a'] ArrayUtils.remove(['a', 'b', 'c'], 1) = ['a', 'c']
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static char[] removeElement(char[] array, char element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 'a') = null ArrayUtils.removeElement([], 'a') = [] ArrayUtils.removeElement(['a'], 'b') = ['a'] ArrayUtils.removeElement(['a', 'b'], 'a') = ['b'] ArrayUtils.removeElement(['a', 'b', 'a'], 'a') = ['b', 'a']
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static double[] remove(double[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([1.1], 0) = [] ArrayUtils.remove([2.5, 6.0], 0) = [6.0] ArrayUtils.remove([2.5, 6.0], 1) = [2.5] ArrayUtils.remove([2.5, 6.0, 3.8], 1) = [2.5, 3.8]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static double[] removeElement(double[] array, double element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 1.1) = null ArrayUtils.removeElement([], 1.1) = [] ArrayUtils.removeElement([1.1], 1.2) = [1.1] ArrayUtils.removeElement([1.1, 2.3], 1.1) = [2.3] ArrayUtils.removeElement([1.1, 2.3, 1.1], 1.1) = [2.3, 1.1]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static float[] remove(float[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([1.1], 0) = [] ArrayUtils.remove([2.5, 6.0], 0) = [6.0] ArrayUtils.remove([2.5, 6.0], 1) = [2.5] ArrayUtils.remove([2.5, 6.0, 3.8], 1) = [2.5, 3.8]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static float[] removeElement(float[] array, float element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 1.1) = null ArrayUtils.removeElement([], 1.1) = [] ArrayUtils.removeElement([1.1], 1.2) = [1.1] ArrayUtils.removeElement([1.1, 2.3], 1.1) = [2.3] ArrayUtils.removeElement([1.1, 2.3, 1.1], 1.1) = [2.3, 1.1]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static int[] remove(int[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([2, 6], 0) = [6] ArrayUtils.remove([2, 6], 1) = [2] ArrayUtils.remove([2, 6, 3], 1) = [2, 3]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static int[] removeElement(int[] array, int element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 2) = [1] ArrayUtils.removeElement([1, 3], 1) = [3] ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static long[] remove(long[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([2, 6], 0) = [6] ArrayUtils.remove([2, 6], 1) = [2] ArrayUtils.remove([2, 6, 3], 1) = [2, 3]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static long[] removeElement(long[] array, long element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 2) = [1] ArrayUtils.removeElement([1, 3], 1) = [3] ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
- 
remove
public static short[] remove(short[] array, int index)Deprecated.Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts one from their indices).
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.
If the input array is
null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([2, 6], 0) = [6] ArrayUtils.remove([2, 6], 1) = [2] ArrayUtils.remove([2, 6, 3], 1) = [2, 3]
- Parameters:
 array- the array to remove the element from, may not benullindex- the position of the element to be removed- Returns:
 - A new array containing the existing elements except the element at the specified position.
 - Throws:
 java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= array.length), or if the array isnull.- Since:
 - 2.1
 
 
- 
removeElement
public static short[] removeElement(short[] array, short element)Deprecated.Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 2) = [1] ArrayUtils.removeElement([1, 3], 1) = [3] ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1]
- Parameters:
 array- the array to remove the element from, may benullelement- the element to be removed- Returns:
 - A new array containing the existing elements except the first occurrence of the specified element.
 - Since:
 - 2.1
 
 
 - 
 
 -