|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.ArrayUtils
public final class ArrayUtils
This class provides a set of utilities to work with arrays.
Constructor Summary | |
---|---|
ArrayUtils()
|
Method Summary | ||
---|---|---|
static
|
createArray(java.lang.Class<T> classType,
int length)
Returns new array with the specified component class type. |
|
static
|
createArray(T[] array,
int length)
Returns new array with the component class type from the specified array. |
|
static int |
indexOf(byte object,
byte[] array)
Returns index of specified byte in array. |
|
static int |
indexOf(char object,
char[] array)
Returns index of specified character in array. |
|
static int |
indexOf(double number,
double[] array)
Returns index of specified double in array. |
|
static int |
indexOf(float number,
float[] array)
Returns index of specified float in array. |
|
static int |
indexOf(int number,
int[] array)
Returns index of specified int in array. |
|
static int |
indexOf(java.lang.Object object,
java.lang.Object[] array)
Returns index of specified object in array. |
|
static int |
indexOf(java.lang.String text,
java.lang.String[] array)
Returns index of specified text in array. |
|
static int |
indexOf(java.lang.String text,
java.lang.String[] array,
boolean ignoreCase)
Returns index of specified text in array. |
|
static boolean[] |
insert(boolean[] array,
int index,
boolean object)
Returns new array with boolean inserted at the specified index. |
|
static byte[] |
insert(byte[] array,
int index,
byte object)
Returns new array with byte inserted at the specified index. |
|
static char[] |
insert(char[] array,
int index,
char object)
Returns new array with char inserted at the specified index. |
|
static double[] |
insert(double[] array,
int index,
double object)
Returns new array with double inserted at the specified index. |
|
static float[] |
insert(float[] array,
int index,
float object)
Returns new array with float inserted at the specified index. |
|
static int[] |
insert(int[] array,
int index,
int object)
Returns new array with int inserted at the specified index. |
|
static
|
insert(T[] array,
int index,
T object)
Returns new array with object inserted at the specified index. |
|
static boolean[] |
remove(boolean[] array,
int index)
Returns new array with the boolean under specified index removed. |
|
static byte[] |
remove(byte[] array,
byte index)
Returns new array with the byte under specified index removed. |
|
static char[] |
remove(char[] array,
char index)
Returns new array with the char under specified index removed. |
|
static double[] |
remove(double[] array,
double index)
Returns new array with the double under specified index removed. |
|
static float[] |
remove(float[] array,
float index)
Returns new array with the float under specified index removed. |
|
static int[] |
remove(int[] array,
int index)
Returns new array with the int under specified index removed. |
|
static
|
remove(T[] array,
int index)
Returns new array with the object under specified index removed. |
|
static
|
remove(T[] array,
T object)
Returns new array with the specified object removed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayUtils()
Method Detail |
---|
public static int indexOf(int number, int[] array)
number
- int to findarray
- array to process
public static int indexOf(float number, float[] array)
number
- float to findarray
- array to process
public static int indexOf(double number, double[] array)
number
- double to findarray
- array to process
public static int indexOf(char object, char[] array)
object
- character to findarray
- array to process
public static int indexOf(byte object, byte[] array)
object
- byte to findarray
- array to process
public static int indexOf(java.lang.String text, java.lang.String[] array)
text
- text to findarray
- array to process
public static int indexOf(java.lang.String text, java.lang.String[] array, boolean ignoreCase)
text
- text to findarray
- array to processignoreCase
- whether ignore text case or not
public static int indexOf(java.lang.Object object, java.lang.Object[] array)
object
- object to findarray
- array to process
public static <T> T[] remove(T[] array, T object)
T
- component typearray
- array to processobject
- object to remove
public static int[] remove(int[] array, int index)
array
- array to processindex
- index of int to remove
public static float[] remove(float[] array, float index)
array
- array to processindex
- index of float to remove
public static double[] remove(double[] array, double index)
array
- array to processindex
- index of double to remove
public static char[] remove(char[] array, char index)
array
- array to processindex
- index of char to remove
public static byte[] remove(byte[] array, byte index)
array
- array to processindex
- index of byte to remove
public static boolean[] remove(boolean[] array, int index)
array
- array to processindex
- index of boolean to remove
public static <T> T[] remove(T[] array, int index)
T
- component typearray
- array to processindex
- index of object to remove
public static int[] insert(int[] array, int index, int object)
array
- array to processindex
- insert indexobject
- int to insert
public static float[] insert(float[] array, int index, float object)
array
- array to processindex
- insert indexobject
- float to insert
public static double[] insert(double[] array, int index, double object)
array
- array to processindex
- insert indexobject
- double to insert
public static char[] insert(char[] array, int index, char object)
array
- array to processindex
- insert indexobject
- char to insert
public static byte[] insert(byte[] array, int index, byte object)
array
- array to processindex
- insert indexobject
- byte to insert
public static boolean[] insert(boolean[] array, int index, boolean object)
array
- array to processindex
- insert indexobject
- boolean to insert
public static <T> T[] insert(T[] array, int index, T object)
T
- component typearray
- array to processindex
- insert indexobject
- object to insert
public static <T> T[] createArray(T[] array, int length)
T
- component typearray
- array to retrieve class type fromlength
- array length
public static <T> T[] createArray(java.lang.Class<T> classType, int length)
T
- component typeclassType
- component class typelength
- array length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |