|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gridsystems.innergrid.kernel.genericutils.ArrayUtil
public final class ArrayUtil
Array related commonly used methods.
| Method Summary | |
|---|---|
static boolean[] |
checkedArray(boolean[] data)
Returns a zero-length array if data is null, or data itself otherwise. |
static java.lang.Object[] |
checkedArray(java.util.Collection col,
java.lang.Class c)
Copies the contents of the specified collection to an array of the type specified by c. |
static float[] |
checkedArray(float[] data)
Returns a zero-length array if data is null, or data itself otherwise. |
static int[] |
checkedArray(int[] data)
Returns a zero-length array if data is null, or data itself otherwise. |
static long[] |
checkedArray(long[] data)
Returns a zero-length array if data is null, or data itself otherwise. |
static java.lang.Object[] |
checkedArray(java.lang.Object[] items,
java.lang.Class c)
Gets a "checked" version of the specified array. |
static java.lang.String[] |
checkedArray(java.lang.String[] data)
Returns a zero-length array if data is null, or data itself otherwise. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.Object[] checkedArray(java.lang.Object[] items,
java.lang.Class c)
First, if the specified array is null, it returns a zero-length array of the type specified in c. If it is not null, it compares the type of the array with c: if both are the same, it returns the array without changes; if they do not coincide, it performs a copy into a newly created array
items - the array to processc - the class of the returning array
java.lang.ArrayStoreException - if an element of items is not compatible with
class c. This should be treated as a fatal error
public static java.lang.Object[] checkedArray(java.util.Collection col,
java.lang.Class c)
col - the collection to processc - the class of the returning array
java.lang.ArrayStoreException - if an element of items is not compatible with
class c. This should be treated as a fatal errorpublic static boolean[] checkedArray(boolean[] data)
data - The array to process
public static int[] checkedArray(int[] data)
data - The array to process
public static long[] checkedArray(long[] data)
data - The array to process
public static float[] checkedArray(float[] data)
data - The array to process
public static java.lang.String[] checkedArray(java.lang.String[] data)
data - The array to process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||