public class ArrayUtils
extends java.lang.Object
Constructor and Description |
---|
ArrayUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean[] |
convertObjectArrayToBoolean(java.lang.Object[] array)
Converts an object array to the primitive type
|
static byte[] |
convertObjectArrayToByte(java.lang.Object[] array)
Converts an object array to the primitive type
|
static char[] |
convertObjectArrayToChar(java.lang.Object[] array)
Converts an object array to the primitive type
|
static double[] |
convertObjectArrayToDouble(java.lang.Object[] array)
Converts an object array to the primitive type
|
static float[] |
convertObjectArrayToFloat(java.lang.Object[] array)
Converts an object array to the primitive type
|
static int[] |
convertObjectArrayToInt(java.lang.Object[] array)
Converts an object array to the primitive type
|
static long[] |
convertObjectArrayToLong(java.lang.Object[] array)
Converts an object array to the primitive type
|
static short[] |
convertObjectArrayToShort(java.lang.Object[] array)
Converts an object array to the primitive type
|
static int |
indexOf(boolean[] array,
boolean key)
Finds the index of the specified key in an array
|
static int |
indexOf(boolean[] array,
boolean key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(byte[] array,
byte key)
Finds the index of the specified key in an array
|
static int |
indexOf(byte[] array,
byte key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(char[] array,
char key)
Finds the index of the specified key in an array
|
static int |
indexOf(char[] array,
char key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(double[] array,
double key)
Finds the index of the specified key in an array
|
static int |
indexOf(double[] array,
double key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(float[] array,
float key)
Finds the index of the specified key in an array
|
static int |
indexOf(float[] array,
float key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(int[] array,
int key)
Finds the index of the specified key in an array
|
static int |
indexOf(int[] array,
int key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(long[] array,
long key)
Finds the index of the specified key in an array
|
static int |
indexOf(long[] array,
long key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(java.lang.Object[] array,
java.lang.Object key)
Finds the index of the specified key in an array
|
static int |
indexOf(java.lang.Object[] array,
java.lang.Object key,
int startIndex)
Finds the index of the specified key in an array
|
static int |
indexOf(short[] array,
short key)
Finds the index of the specified key in an array
|
static int |
indexOf(short[] array,
short key,
int startIndex)
Finds the index of the specified key in an array
|
static boolean[] |
removeRepeats(boolean[] array)
Removes any repeating data from the array
|
static byte[] |
removeRepeats(byte[] array)
Removes any repeating data from the array
|
static char[] |
removeRepeats(char[] array)
Removes any repeating data from the array
|
static double[] |
removeRepeats(double[] array)
Removes any repeating data from the array
|
static float[] |
removeRepeats(float[] array)
Removes any repeating data from the array
|
static int[] |
removeRepeats(int[] array)
Removes any repeating data from the array
|
static long[] |
removeRepeats(long[] array)
Removes any repeating data from the array
|
static short[] |
removeRepeats(short[] array)
Removes any repeating data from the array
|
static <T> T[] |
removeRepeats(T[] array)
Removes any repeating data from the array
|
static java.lang.String[] |
trimAll(java.lang.String[] array)
Performs the
String.trim() method on all strings in an array |
static boolean |
wrappedRetrieve(boolean[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static byte |
wrappedRetrieve(byte[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static char |
wrappedRetrieve(char[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static double |
wrappedRetrieve(double[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static float |
wrappedRetrieve(float[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static int |
wrappedRetrieve(int[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static long |
wrappedRetrieve(long[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static short |
wrappedRetrieve(short[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
static <T> T |
wrappedRetrieve(T[] array,
int index)
Gets the value from an array, prevents
ArrayIndexOutOfBoundsException by wrapping |
public static int indexOf(java.lang.Object[] array, java.lang.Object key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(byte[] array, byte key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(short[] array, short key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(int[] array, int key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(long[] array, long key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(float[] array, float key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(double[] array, double key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(boolean[] array, boolean key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(char[] array, char key)
array
- The array to searchkey
- The key to search forpublic static int indexOf(java.lang.Object[] array, java.lang.Object key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(byte[] array, byte key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(short[] array, short key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(int[] array, int key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(long[] array, long key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(float[] array, float key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(double[] array, double key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(boolean[] array, boolean key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static int indexOf(char[] array, char key, int startIndex)
array
- The array to searchkey
- The key to search forstartIndex
- The index to start searching frompublic static <T> T wrappedRetrieve(T[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static byte wrappedRetrieve(byte[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static short wrappedRetrieve(short[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static int wrappedRetrieve(int[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static long wrappedRetrieve(long[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static float wrappedRetrieve(float[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static double wrappedRetrieve(double[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static boolean wrappedRetrieve(boolean[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static char wrappedRetrieve(char[] array, int index)
ArrayIndexOutOfBoundsException
by wrappingarray
- The array to useindex
- The index to get the value frompublic static <T> T[] removeRepeats(T[] array)
array
- The array to remove repeats frompublic static byte[] removeRepeats(byte[] array)
array
- The array to remove repeats frompublic static short[] removeRepeats(short[] array)
array
- The array to remove repeats frompublic static int[] removeRepeats(int[] array)
array
- The array to remove repeats frompublic static long[] removeRepeats(long[] array)
array
- The array to remove repeats frompublic static float[] removeRepeats(float[] array)
array
- The array to remove repeats frompublic static double[] removeRepeats(double[] array)
array
- The array to remove repeats frompublic static boolean[] removeRepeats(boolean[] array)
array
- The array to remove repeats frompublic static char[] removeRepeats(char[] array)
array
- The array to remove repeats frompublic static java.lang.String[] trimAll(java.lang.String[] array)
String.trim()
method on all strings in an arrayarray
- The array to trimpublic static byte[] convertObjectArrayToByte(java.lang.Object[] array)
array
- The object arraypublic static short[] convertObjectArrayToShort(java.lang.Object[] array)
array
- The object arraypublic static int[] convertObjectArrayToInt(java.lang.Object[] array)
array
- The object arraypublic static long[] convertObjectArrayToLong(java.lang.Object[] array)
array
- The object arraypublic static float[] convertObjectArrayToFloat(java.lang.Object[] array)
array
- The object arraypublic static double[] convertObjectArrayToDouble(java.lang.Object[] array)
array
- The object arraypublic static boolean[] convertObjectArrayToBoolean(java.lang.Object[] array)
array
- The object arraypublic static char[] convertObjectArrayToChar(java.lang.Object[] array)
array
- The object array