|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.ldap.util.ArrayUtils
public class ArrayUtils
Operations on arrays, primitive arrays (like int[]) and
primitive wrapper arrays (like Integer[]).
This class tries to handle null input gracefully. An exception
will not be thrown for a null array input. However, an Object
array that contains a null element may throw an exception.
Each method documents its behaviour.
| Field Summary | |
|---|---|
static boolean[] |
EMPTY_BOOLEAN_ARRAY
An empty immutable boolean array. |
static java.lang.Boolean[] |
EMPTY_BOOLEAN_OBJECT_ARRAY
An empty immutable Boolean array. |
static byte[] |
EMPTY_BYTE_ARRAY
An empty immutable byte array. |
static java.lang.Byte[] |
EMPTY_BYTE_OBJECT_ARRAY
An empty immutable Byte array. |
static char[] |
EMPTY_CHAR_ARRAY
An empty immutable char array. |
static java.lang.Character[] |
EMPTY_CHARACTER_OBJECT_ARRAY
An empty immutable Character array. |
static java.lang.Class<?>[] |
EMPTY_CLASS_ARRAY
An empty immutable Class array. |
static double[] |
EMPTY_DOUBLE_ARRAY
An empty immutable double array. |
static java.lang.Double[] |
EMPTY_DOUBLE_OBJECT_ARRAY
An empty immutable Double array. |
static float[] |
EMPTY_FLOAT_ARRAY
An empty immutable float array. |
static java.lang.Float[] |
EMPTY_FLOAT_OBJECT_ARRAY
An empty immutable Float array. |
static int[] |
EMPTY_INT_ARRAY
An empty immutable int array. |
static java.lang.Integer[] |
EMPTY_INTEGER_OBJECT_ARRAY
An empty immutable Integer array. |
static long[] |
EMPTY_LONG_ARRAY
An empty immutable long array. |
static java.lang.Long[] |
EMPTY_LONG_OBJECT_ARRAY
An empty immutable Long array. |
static java.lang.Object[] |
EMPTY_OBJECT_ARRAY
An empty immutable Object array. |
static short[] |
EMPTY_SHORT_ARRAY
An empty immutable short array. |
static java.lang.Short[] |
EMPTY_SHORT_OBJECT_ARRAY
An empty immutable Short array. |
static java.lang.String[] |
EMPTY_STRING_ARRAY
An empty immutable String array. |
| Constructor Summary | |
|---|---|
ArrayUtils()
ArrayUtils instances should NOT be constructed in standard programming. |
|
| Method Summary | |
|---|---|
static boolean[] |
add(boolean[] array,
boolean element)
Copies the given array and adds the given element at the end of the new array. |
static byte[] |
add(byte[] array,
byte element)
Copies the given array and adds the given element at the end of the new array. |
static char[] |
add(char[] array,
char element)
Copies the given array and adds the given element at the end of the new array. |
static double[] |
add(double[] array,
double element)
Copies the given array and adds the given element at the end of the new array. |
static float[] |
add(float[] array,
float element)
Copies the given array and adds the given element at the end of the new array. |
static int[] |
add(int[] array,
int element)
Copies the given array and adds the given element at the end of the new array. |
static long[] |
add(long[] array,
long element)
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)
Inserts the specified element at the specified position in the array. |
static java.lang.Object[] |
add(java.lang.Object[] array,
java.lang.Object element)
Copies the given array and adds the given element at the end of the new array. |
static short[] |
add(short[] array,
short element)
Copies the given array and adds the given element at the end of the new array. |
static java.lang.Object[] |
addAll(java.lang.Object[] array1,
java.lang.Object[] array2)
Adds all the elements of the given arrays into a new array. |
static boolean[] |
clone(boolean[] array)
Clones an array returning a typecast result and handling null. |
static byte[] |
clone(byte[] array)
Clones an array returning a typecast result and handling null. |
static char[] |
clone(char[] array)
Clones an array returning a typecast result and handling null. |
static double[] |
clone(double[] array)
Clones an array returning a typecast result and handling null. |
static float[] |
clone(float[] array)
Clones an array returning a typecast result and handling null. |
static int[] |
clone(int[] array)
Clones an array returning a typecast result and handling null. |
static long[] |
clone(long[] array)
Clones an array returning a typecast result and handling null. |
static java.lang.Object[] |
clone(java.lang.Object[] array)
Shallow clones an array returning a typecast result and handling null. |
static short[] |
clone(short[] array)
Clones an array returning a typecast result and handling null. |
static boolean |
contains(boolean[] array,
boolean valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(byte[] array,
byte valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(char[] array,
char valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(double[] array,
double valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(double[] array,
double valueToFind,
double tolerance)
Checks if a value falling within the given tolerance is in the given array. |
static boolean |
contains(float[] array,
float valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(int[] array,
int valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(long[] array,
long valueToFind)
Checks if the value is in the given array. |
static boolean |
contains(java.lang.Object[] array,
java.lang.Object objectToFind)
Checks if the object is in the given array. |
static boolean |
contains(short[] array,
short valueToFind)
Checks if the value is in the given array. |
static int |
getLength(java.lang.Object array)
Returns the length of the specified array. |
static int |
hashCode(java.lang.Object array)
Get a hashCode for an array handling multi-dimensional arrays correctly. |
static int |
indexOf(boolean[] array,
boolean valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(boolean[] array,
boolean valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(byte[] array,
byte valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(byte[] array,
byte valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(char[] array,
char valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(char[] array,
char valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(double[] array,
double valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(double[] array,
double valueToFind,
double tolerance)
Find the index of the given value within a given tolerance in the array. |
static int |
indexOf(double[] array,
double valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(double[] array,
double valueToFind,
int startIndex,
double tolerance)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(float[] array,
float valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(float[] array,
float valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(int[] array,
int valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(int[] array,
int valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(long[] array,
long valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(long[] array,
long valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static int |
indexOf(java.lang.Object[] array,
java.lang.Object objectToFind)
Find the index of the given object in the array. |
static int |
indexOf(java.lang.Object[] array,
java.lang.Object objectToFind,
int startIndex)
Find the index of the given object in the array starting at the given index. |
static int |
indexOf(short[] array,
short valueToFind)
Find the index of the given value in the array. |
static int |
indexOf(short[] array,
short valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index. |
static boolean |
isEmpty(boolean[] array)
Checks if an array of primitive booleans is empty or null. |
static boolean |
isEmpty(byte[] array)
Checks if an array of primitive bytes is empty or null. |
static boolean |
isEmpty(char[] array)
Checks if an array of primitive chars is empty or null. |
static boolean |
isEmpty(double[] array)
Checks if an array of primitive doubles is empty or null. |
static boolean |
isEmpty(float[] array)
Checks if an array of primitive floats is empty or null. |
static boolean |
isEmpty(int[] array)
Checks if an array of primitive ints is empty or null. |
static boolean |
isEmpty(long[] array)
Checks if an array of primitive longs is empty or null. |
static boolean |
isEmpty(java.lang.Object[] array)
Checks if an array of Objects is empty or null. |
static boolean |
isEmpty(short[] array)
Checks if an array of primitive shorts is empty or null. |
static boolean |
isEquals(java.lang.Object array1,
java.lang.Object array2)
Compares two arrays, using equals(), handling multi-dimensional arrays correctly. |
static boolean |
isSameLength(boolean[] array1,
boolean[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(byte[] array1,
byte[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(char[] array1,
char[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(double[] array1,
double[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(float[] array1,
float[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(int[] array1,
int[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(long[] array1,
long[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(java.lang.Object[] array1,
java.lang.Object[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameLength(short[] array1,
short[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0. |
static boolean |
isSameType(java.lang.Object array1,
java.lang.Object array2)
Checks whether two arrays are the same type taking into account multi-dimensional arrays. |
static int |
lastIndex(java.lang.Object array)
Returns the last index of the given array or -1 if empty or null. |
static int |
lastIndexOf(boolean[] array,
boolean valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(boolean[] array,
boolean valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(byte[] array,
byte valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(byte[] array,
byte valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(char[] array,
char valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(char[] array,
char valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(double[] array,
double valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(double[] array,
double valueToFind,
double tolerance)
Find the last index of the given value within a given tolerance in the array. |
static int |
lastIndexOf(double[] array,
double valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(double[] array,
double valueToFind,
int startIndex,
double tolerance)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(float[] array,
float valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(float[] array,
float valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(int[] array,
int valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(int[] array,
int valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(long[] array,
long valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(long[] array,
long valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static int |
lastIndexOf(java.lang.Object[] array,
java.lang.Object objectToFind)
Find the last index of the given object within the array. |
static int |
lastIndexOf(java.lang.Object[] array,
java.lang.Object objectToFind,
int startIndex)
Find the last index of the given object in the array starting at the given index. |
static int |
lastIndexOf(short[] array,
short valueToFind)
Find the last index of the given value within the array. |
static int |
lastIndexOf(short[] array,
short valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index. |
static boolean[] |
remove(boolean[] array,
int index)
Removes the element at the specified position from the specified array. |
static byte[] |
remove(byte[] array,
int index)
Removes the element at the specified position from the specified array. |
static char[] |
remove(char[] array,
int index)
Removes the element at the specified position from the specified array. |
static double[] |
remove(double[] array,
int index)
Removes the element at the specified position from the specified array. |
static float[] |
remove(float[] array,
int index)
Removes the element at the specified position from the specified array. |
static int[] |
remove(int[] array,
int index)
Removes the element at the specified position from the specified array. |
static long[] |
remove(long[] array,
int index)
Removes the element at the specified position from the specified array. |
static java.lang.Object[] |
remove(java.lang.Object[] array,
int index)
Removes the element at the specified position from the specified array. |
static short[] |
remove(short[] array,
int index)
Removes the element at the specified position from the specified array. |
static boolean[] |
removeElement(boolean[] array,
boolean element)
Removes the first occurrence of the specified element from the specified array. |
static byte[] |
removeElement(byte[] array,
byte element)
Removes the first occurrence of the specified element from the specified array. |
static char[] |
removeElement(char[] array,
char element)
Removes the first occurrence of the specified element from the specified array. |
static double[] |
removeElement(double[] array,
double element)
Removes the first occurrence of the specified element from the specified array. |
static float[] |
removeElement(float[] array,
float element)
Removes the first occurrence of the specified element from the specified array. |
static int[] |
removeElement(int[] array,
int element)
Removes the first occurrence of the specified element from the specified array. |
static long[] |
removeElement(long[] array,
long element)
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)
Removes the first occurrence of the specified element from the specified array. |
static short[] |
removeElement(short[] array,
short element)
Removes the first occurrence of the specified element from the specified array. |
static void |
reverse(boolean[] array)
Reverses the order of the given array. |
static void |
reverse(byte[] array)
Reverses the order of the given array. |
static void |
reverse(char[] array)
Reverses the order of the given array. |
static void |
reverse(double[] array)
Reverses the order of the given array. |
static void |
reverse(float[] array)
Reverses the order of the given array. |
static void |
reverse(int[] array)
Reverses the order of the given array. |
static void |
reverse(long[] array)
Reverses the order of the given array. |
static void |
reverse(java.lang.Object[] array)
Reverses the order of the given array. |
static void |
reverse(short[] array)
Reverses the order of the given array. |
static boolean[] |
subarray(boolean[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new boolean array containing the elements
between the start and end indices. |
static byte[] |
subarray(byte[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new byte array containing the elements between
the start and end indices. |
static char[] |
subarray(char[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new char array containing the elements between
the start and end indices. |
static double[] |
subarray(double[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new double array containing the elements
between the start and end indices. |
static float[] |
subarray(float[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new float array containing the elements between
the start and end indices. |
static int[] |
subarray(int[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new int array containing the elements between
the start and end indices. |
static long[] |
subarray(long[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new long array containing the elements between
the start and end indices. |
static java.lang.Object[] |
subarray(java.lang.Object[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new array containing the elements between the start and end indices. |
static short[] |
subarray(short[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new short array containing the elements between
the start and end indices. |
static java.lang.Boolean[] |
toObject(boolean[] array)
Converts an array of primitive booleans to objects. |
static java.lang.Byte[] |
toObject(byte[] array)
Converts an array of primitive bytes to objects. |
static java.lang.Double[] |
toObject(double[] array)
Converts an array of primitive doubles to objects. |
static java.lang.Float[] |
toObject(float[] array)
Converts an array of primitive floats to objects. |
static java.lang.Integer[] |
toObject(int[] array)
Converts an array of primitive ints to objects. |
static java.lang.Long[] |
toObject(long[] array)
Converts an array of primitive longs to objects. |
static java.lang.Short[] |
toObject(short[] array)
Converts an array of primitive shorts to objects. |
static boolean[] |
toPrimitive(java.lang.Boolean[] array)
Converts an array of object Booleans to primitives. |
static boolean[] |
toPrimitive(java.lang.Boolean[] array,
boolean valueForNull)
Converts an array of object Booleans to primitives handling null. |
static byte[] |
toPrimitive(java.lang.Byte[] array)
Converts an array of object Bytes to primitives. |
static byte[] |
toPrimitive(java.lang.Byte[] array,
byte valueForNull)
Converts an array of object Bytes to primitives handling null. |
static double[] |
toPrimitive(java.lang.Double[] array)
Converts an array of object Doubles to primitives. |
static double[] |
toPrimitive(java.lang.Double[] array,
double valueForNull)
Converts an array of object Doubles to primitives handling null. |
static float[] |
toPrimitive(java.lang.Float[] array)
Converts an array of object Floats to primitives. |
static float[] |
toPrimitive(java.lang.Float[] array,
float valueForNull)
Converts an array of object Floats to primitives handling null. |
static int[] |
toPrimitive(java.lang.Integer[] array)
Converts an array of object Integers to primitives. |
static int[] |
toPrimitive(java.lang.Integer[] array,
int valueForNull)
Converts an array of object Integer to primitives handling null. |
static long[] |
toPrimitive(java.lang.Long[] array)
Converts an array of object Longs to primitives. |
static long[] |
toPrimitive(java.lang.Long[] array,
long valueForNull)
Converts an array of object Long to primitives handling null. |
static short[] |
toPrimitive(java.lang.Short[] array)
Converts an array of object Shorts to primitives. |
static short[] |
toPrimitive(java.lang.Short[] array,
short valueForNull)
Converts an array of object Short to primitives handling null. |
static java.lang.String |
toString(java.lang.Object array)
Outputs an array as a String, treating null as an empty
array. |
static java.lang.String |
toString(java.lang.Object array,
java.lang.String stringIfNull)
Outputs an array as a String handling nulls. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Object[] EMPTY_OBJECT_ARRAY
Object array.
public static final java.lang.Class<?>[] EMPTY_CLASS_ARRAY
Class array.
public static final java.lang.String[] EMPTY_STRING_ARRAY
String array.
public static final long[] EMPTY_LONG_ARRAY
long array.
public static final java.lang.Long[] EMPTY_LONG_OBJECT_ARRAY
Long array.
public static final int[] EMPTY_INT_ARRAY
int array.
public static final java.lang.Integer[] EMPTY_INTEGER_OBJECT_ARRAY
Integer array.
public static final short[] EMPTY_SHORT_ARRAY
short array.
public static final java.lang.Short[] EMPTY_SHORT_OBJECT_ARRAY
Short array.
public static final byte[] EMPTY_BYTE_ARRAY
byte array.
public static final java.lang.Byte[] EMPTY_BYTE_OBJECT_ARRAY
Byte array.
public static final double[] EMPTY_DOUBLE_ARRAY
double array.
public static final java.lang.Double[] EMPTY_DOUBLE_OBJECT_ARRAY
Double array.
public static final float[] EMPTY_FLOAT_ARRAY
float array.
public static final java.lang.Float[] EMPTY_FLOAT_OBJECT_ARRAY
Float array.
public static final boolean[] EMPTY_BOOLEAN_ARRAY
boolean array.
public static final java.lang.Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY
Boolean array.
public static final char[] EMPTY_CHAR_ARRAY
char array.
public static final java.lang.Character[] EMPTY_CHARACTER_OBJECT_ARRAY
Character array.
| Constructor Detail |
|---|
public ArrayUtils()
ArrayUtils instances should NOT be constructed in standard programming.
Instead, the class should be used as
ArrayUtils.clone(new int[] {2}).
This constructor is public to permit tools that require a JavaBean instance to operate.
| Method Detail |
|---|
public static java.lang.String toString(java.lang.Object array)
Outputs an array as a String, treating null as 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}.
array - the array to get a toString for, may be null
public static java.lang.String toString(java.lang.Object array,
java.lang.String stringIfNull)
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}.
array - the array to get a toString for, may be nullstringIfNull - the String to return if the array is null
public static int hashCode(java.lang.Object array)
Get a hashCode for an array handling multi-dimensional arrays correctly.
Multi-dimensional primitive arrays are also handled correctly by this method.
array - the array to get a hashCode for, may be null
public static boolean isEquals(java.lang.Object array1,
java.lang.Object array2)
Compares two arrays, using equals(), handling multi-dimensional arrays correctly.
Multi-dimensional primitive arrays are also handled correctly by this method.
array1 - the left hand array to compare, may be nullarray2 - the right hand array to compare, may be null
true if the arrays are equalpublic static java.lang.Object[] clone(java.lang.Object[] array)
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 null if null array
input.
array - the array to shallow clone, may be null
null if null
inputpublic static long[] clone(long[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static int[] clone(int[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static short[] clone(short[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static char[] clone(char[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static byte[] clone(byte[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static double[] clone(double[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static float[] clone(float[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
inputpublic static boolean[] clone(boolean[] array)
Clones an array returning a typecast result and handling
null.
This method returns null if null array
input.
array - the array to clone, may be null
null if null
input
public static java.lang.Object[] subarray(java.lang.Object[] array,
int startIndexInclusive,
int endIndexExclusive)
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 );
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.
public static long[] subarray(long[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new long 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.
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.
public static int[] subarray(int[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new int 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.
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.
public static short[] subarray(short[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new short 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.
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.
public static char[] subarray(char[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new char 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.
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.
public static byte[] subarray(byte[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new byte 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.
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.
public static double[] subarray(double[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new double 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.
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.
public static float[] subarray(float[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new float 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.
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.
public static boolean[] subarray(boolean[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new boolean 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.
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.
public static boolean isSameLength(java.lang.Object[] array1,
java.lang.Object[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
Any multi-dimensional aspects of the arrays are ignored.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(long[] array1,
long[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(int[] array1,
int[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(short[] array1,
short[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(char[] array1,
char[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(byte[] array1,
byte[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(double[] array1,
double[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(float[] array1,
float[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty array
public static boolean isSameLength(boolean[] array1,
boolean[] array2)
Checks whether two arrays are the same length, treating null
arrays as length 0.
array1 - the first array, may be nullarray2 - the second array, may be null
true if length of arrays matches, treating
null as an empty arraypublic static int getLength(java.lang.Object array)
Returns the length of the specified array. This method can deal with
Object arrays and with primitive arrays.
If the input array is null, 0 is 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
array - the array to retrieve the length from, may be null
0 if the array is
null
java.lang.IllegalArgumentException - if the object arguement is not an array.public static int lastIndex(java.lang.Object array)
Object arrays and with primitive
arrays. This value is one less than the size since arrays indices are
0-based.
ArrayUtils.lastIndex(null) = -1 ArrayUtils.lastIndex([]) = -1 ArrayUtils.lastIndex([null]) = 0 ArrayUtils.lastIndex([true, false]) = 1 ArrayUtils.lastIndex([1, 2, 3]) = 2 ArrayUtils.lastIndex(["a", "b", "c"]) = 2
array - the array to return the last index for, may be null
java.lang.IllegalArgumentException - if the object arguement is not an array.
public static boolean isSameType(java.lang.Object array1,
java.lang.Object array2)
Checks whether two arrays are the same type taking into account multi-dimensional arrays.
array1 - the first array, must not be nullarray2 - the second array, must not be null
true if type of arrays matches
java.lang.IllegalArgumentException - if either array is nullpublic static void reverse(java.lang.Object[] array)
Reverses the order of the given array.
There is no special handling for multi-dimensional arrays.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(long[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(int[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(short[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(char[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(byte[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(double[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(float[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be nullpublic static void reverse(boolean[] array)
Reverses the order of the given array.
This method does nothing if null array input.
array - the array to reverse, may be null
public static int indexOf(java.lang.Object[] array,
java.lang.Object objectToFind)
Find the index of the given object in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullobjectToFind - the object to find, may be null
-1 if
not found or null array input
public static int indexOf(java.lang.Object[] array,
java.lang.Object objectToFind,
int startIndex)
Find the index of the given object in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the
array length will return -1.
array - the array to search through for the object, may be
nullobjectToFind - the object to find, may be nullstartIndex - the index to start searching at
-1 if not found or null array input
public static int lastIndexOf(java.lang.Object[] array,
java.lang.Object objectToFind)
Find the last index of the given object within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullobjectToFind - the object to find, may be null
-1
if not found or null array input
public static int lastIndexOf(java.lang.Object[] array,
java.lang.Object objectToFind,
int startIndex)
Find the last index of the given object in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger
than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullobjectToFind - the object to find, may be nullstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(java.lang.Object[] array,
java.lang.Object objectToFind)
Checks if the object is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughobjectToFind - the object to find
true if the array contains the object
public static int indexOf(long[] array,
long valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(long[] array,
long valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(long[] array,
long valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(long[] array,
long valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(long[] array,
long valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static int indexOf(int[] array,
int valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(int[] array,
int valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(int[] array,
int valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(int[] array,
int valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(int[] array,
int valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static int indexOf(short[] array,
short valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(short[] array,
short valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(short[] array,
short valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(short[] array,
short valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(short[] array,
short valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static int indexOf(char[] array,
char valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(char[] array,
char valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(char[] array,
char valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(char[] array,
char valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(char[] array,
char valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static int indexOf(byte[] array,
byte valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(byte[] array,
byte valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(byte[] array,
byte valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(byte[] array,
byte valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(byte[] array,
byte valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static int indexOf(double[] array,
double valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(double[] array,
double valueToFind,
double tolerance)
Find 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 -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to findtolerance - tolerance of the search
-1 if not
found or null array input
public static int indexOf(double[] array,
double valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int indexOf(double[] array,
double valueToFind,
int startIndex,
double tolerance)
Find 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 -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching attolerance - tolerance of the search
-1 if not
found or null array input
public static int lastIndexOf(double[] array,
double valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(double[] array,
double valueToFind,
double tolerance)
Find 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 -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to findtolerance - tolerance of the search
-1 if not
found or null array input
public static int lastIndexOf(double[] array,
double valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static int lastIndexOf(double[] array,
double valueToFind,
int startIndex,
double tolerance)
Find 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 -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards fromtolerance - search for value within plus/minus this amount
-1
if not found or null array input
public static boolean contains(double[] array,
double valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static boolean contains(double[] array,
double valueToFind,
double tolerance)
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 false if a null array is
passed in.
array - the array to searchvalueToFind - the value to findtolerance - the array contains the tolerance of the search
public static int indexOf(float[] array,
float valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(float[] array,
float valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(float[] array,
float valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(float[] array,
float valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(float[] array,
float valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the object
public static int indexOf(boolean[] array,
boolean valueToFind)
Find the index of the given value in the array.
This method returns -1 if null array input.
array - the array to search through for the object, may be
nullvalueToFind - the value to find
-1 if not
found or null array input
public static int indexOf(boolean[] array,
boolean valueToFind,
int startIndex)
Find the index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex is treated as zero. A startIndex larger than the array length will return -1.
array - the array to search through for the object, may be
nullvalueToFind - the value to findstartIndex - the index to start searching at
-1 if not
found or null array input
public static int lastIndexOf(boolean[] array,
boolean valueToFind)
Find the last index of the given value within the array.
This method returns -1 if null array input.
array - the array to travers backwords looking for the object, may be
nullvalueToFind - the object to find
-1
if not found or null array input
public static int lastIndexOf(boolean[] array,
boolean valueToFind,
int startIndex)
Find the last index of the given value in the array starting at the given index.
This method returns -1 if null array input.
A negative startIndex will return -1. A startIndex larger than the array length will search from the end of the array.
array - the array to traverse for looking for the object, may be
nullvalueToFind - the value to findstartIndex - the start index to travers backwards from
-1
if not found or null array input
public static boolean contains(boolean[] array,
boolean valueToFind)
Checks if the value is in the given array.
The method returns false if a null array is
passed in.
array - the array to search throughvalueToFind - the value to find
true if the array contains the objectpublic static long[] toPrimitive(java.lang.Long[] array)
Converts an array of object Longs to primitives.
This method returns null if null array
input.
array - a Long array, may be null
long array, null if null array
input
java.lang.NullPointerException - if array content is null
public static long[] toPrimitive(java.lang.Long[] array,
long valueForNull)
Converts an array of object Long to primitives handling null.
This method returns null if null array
input.
array - a Long array, may be nullvalueForNull - the value to insert if null found
long array, null if null array
inputpublic static java.lang.Long[] toObject(long[] array)
Converts an array of primitive longs to objects.
This method returns null if null array
input.
array - a long array
Long array, null if null array
inputpublic static int[] toPrimitive(java.lang.Integer[] array)
Converts an array of object Integers to primitives.
This method returns null if null array
input.
array - a Integer array, may be null
int array, null if null array
input
java.lang.NullPointerException - if array content is null
public static int[] toPrimitive(java.lang.Integer[] array,
int valueForNull)
Converts an array of object Integer to primitives handling
null.
This method returns null if null array
input.
array - a Integer array, may be nullvalueForNull - the value to insert if null found
int array, null if null array
inputpublic static java.lang.Integer[] toObject(int[] array)
Converts an array of primitive ints to objects.
This method returns null if null array
input.
array - an int array
Integer array, null if null
array inputpublic static short[] toPrimitive(java.lang.Short[] array)
Converts an array of object Shorts to primitives.
This method returns null if null array
input.
array - a Short array, may be null
byte array, null if null array
input
java.lang.NullPointerException - if array content is null
public static short[] toPrimitive(java.lang.Short[] array,
short valueForNull)
Converts an array of object Short to primitives handling
null.
This method returns null if null array
input.
array - a Short array, may be nullvalueForNull - the value to insert if null found
byte array, null if null array
inputpublic static java.lang.Short[] toObject(short[] array)
Converts an array of primitive shorts to objects.
This method returns null if null array
input.
array - a short array
Short array, null if null array
inputpublic static byte[] toPrimitive(java.lang.Byte[] array)
Converts an array of object Bytes to primitives.
This method returns null if null array
input.
array - a Byte array, may be null
byte array, null if null array
input
java.lang.NullPointerException - if array content is null
public static byte[] toPrimitive(java.lang.Byte[] array,
byte valueForNull)
Converts an array of object Bytes to primitives handling
null.
This method returns null if null array
input.
array - a Byte array, may be nullvalueForNull - the value to insert if null found
byte array, null if null array
inputpublic static java.lang.Byte[] toObject(byte[] array)
Converts an array of primitive bytes to objects.
This method returns null if null array
input.
array - a byte array
Byte array, null if null array
inputpublic static double[] toPrimitive(java.lang.Double[] array)
Converts an array of object Doubles to primitives.
This method returns null if null array
input.
array - a Double array, may be null
double array, null if null array
input
java.lang.NullPointerException - if array content is null
public static double[] toPrimitive(java.lang.Double[] array,
double valueForNull)
Converts an array of object Doubles to primitives handling
null.
This method returns null if null array
input.
array - a Double array, may be nullvalueForNull - the value to insert if null found
double array, null if null array
inputpublic static java.lang.Double[] toObject(double[] array)
Converts an array of primitive doubles to objects.
This method returns null if null array
input.
array - a double array
Double array, null if null array
inputpublic static float[] toPrimitive(java.lang.Float[] array)
Converts an array of object Floats to primitives.
This method returns null if null array
input.
array - a Float array, may be null
float array, null if null array
input
java.lang.NullPointerException - if array content is null
public static float[] toPrimitive(java.lang.Float[] array,
float valueForNull)
Converts an array of object Floats to primitives handling
null.
This method returns null if null array
input.
array - a Float array, may be nullvalueForNull - the value to insert if null found
float array, null if null array
inputpublic static java.lang.Float[] toObject(float[] array)
Converts an array of primitive floats to objects.
This method returns null if null array
input.
array - a float array
Float array, null if null array
inputpublic static boolean[] toPrimitive(java.lang.Boolean[] array)
Converts an array of object Booleans to primitives.
This method returns null if null array
input.
array - a Boolean array, may be null
boolean array, null if null array
input
java.lang.NullPointerException - if array content is null
public static boolean[] toPrimitive(java.lang.Boolean[] array,
boolean valueForNull)
Converts an array of object Booleans to primitives handling
null.
This method returns null if null array
input.
array - a Boolean array, may be nullvalueForNull - the value to insert if null found
boolean array, null if null array
inputpublic static java.lang.Boolean[] toObject(boolean[] array)
Converts an array of primitive booleans to objects.
This method returns null if null array
input.
array - a boolean array
Boolean array, null if null array
inputpublic static boolean isEmpty(java.lang.Object[] array)
Checks if an array of Objects is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(long[] array)
Checks if an array of primitive longs is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(int[] array)
Checks if an array of primitive ints is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(short[] array)
Checks if an array of primitive shorts is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(char[] array)
Checks if an array of primitive chars is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(byte[] array)
Checks if an array of primitive bytes is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(double[] array)
Checks if an array of primitive doubles is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(float[] array)
Checks if an array of primitive floats is empty or null.
array - the array to test
true if the array is empty or nullpublic static boolean isEmpty(boolean[] array)
Checks if an array of primitive booleans is empty or null.
array - the array to test
true if the array is empty or null
public static java.lang.Object[] addAll(java.lang.Object[] array1,
java.lang.Object[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1
followed by all of the elements array2. 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"]
array1 - the first array whose elements are added to the new array, may
be nullarray2 - the second array whose elements are added to the new array,
may be null
null if null array
inputs. The type of the new array is the type of the first array.
public static java.lang.Object[] add(java.lang.Object[] array,
java.lang.Object element)
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, 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"]
array - the array to "add" the element to, may be nullelement - the object to add
public static boolean[] add(boolean[] array,
boolean element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static byte[] add(byte[] array,
byte element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static char[] add(char[] array,
char element)
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']
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static double[] add(double[] array,
double element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static float[] add(float[] array,
float element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static int[] add(int[] array,
int element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static long[] add(long[] array,
long element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static short[] add(short[] array,
short element)
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]
array - the array to copy and add the element to, may be
nullelement - the object to add at the last index of the new array
public static java.lang.Object[] add(java.lang.Object[] array,
int index,
java.lang.Object element)
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"]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to add
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >
array.length).
public static java.lang.Object[] remove(java.lang.Object[] array,
int index)
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"]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static java.lang.Object[] removeElement(java.lang.Object[] array,
java.lang.Object element)
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"]
array - the array to remove the element from, may be nullelement - the element to be removed
public static boolean[] remove(boolean[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static boolean[] removeElement(boolean[] array,
boolean element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
public static byte[] remove(byte[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static byte[] removeElement(byte[] array,
byte element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
public static char[] remove(char[] array,
int index)
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']
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static char[] removeElement(char[] array,
char element)
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']
array - the array to remove the element from, may be nullelement - the element to be removed
public static double[] remove(double[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static double[] removeElement(double[] array,
double element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
public static float[] remove(float[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static float[] removeElement(float[] array,
float element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
public static int[] remove(int[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static int[] removeElement(int[] array,
int element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
public static long[] remove(long[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static long[] removeElement(long[] array,
long element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
public static short[] remove(short[] array,
int index)
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]
array - the array to remove the element from, may not be
nullindex - the position of the element to be removed
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
array.length), or if the array is null.
public static short[] removeElement(short[] array,
short element)
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]
array - the array to remove the element from, may be nullelement - the element to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||