|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jutil.java.collections.Arrays
A class with static methods for arrays
Field Summary | |
static java.lang.String |
CVS_REVISION
|
Constructor Summary | |
Arrays()
|
Method Summary | |
static int[] |
getArrayDimensions(java.lang.Object[] array)
// pre array != null; Return the dimensions of the given array |
static java.lang.Class |
getArrayType(java.lang.Object array)
// pre array != null; // pre array.getClass().isArray(); Return the type of an array |
static boolean |
isObjectArray(java.lang.Class clazz)
// False is post (clazz == null) ==> (\result == false); //Return true if post \result == clazz.isArray() && (clazz.getName().indexOf("[L") != -1); Check whether the given class is an array of objects |
static boolean |
isObjectArray(java.lang.Object object)
// False is |
static java.lang.Object[] |
newArray(java.lang.Object[] array)
// pre array != null; // The returned array is not null post \result != null; // The returned array has the same type as post getArrayType(\result) == getArrayType(array); // The returned array has the same dimensions as post (\forall int i; i >= 0 && i < getArrayDimensions(array).length; getArrayDimensions(\result)[i] == getArrayDimensions(array)[i]); Return a new array of the same type and dimension as the given array. |
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.String CVS_REVISION
Constructor Detail |
public Arrays()
Method Detail |
public static java.lang.Object[] newArray(java.lang.Object[] array) throws ZeroDimensionException
array
- an array that will be "cloned"public static int[] getArrayDimensions(java.lang.Object[] array) throws ZeroDimensionException
array
- The array of which the dimensions are requestedpublic static java.lang.Class getArrayType(java.lang.Object array)
array
- The array of which the type must be determinedpublic static boolean isObjectArray(java.lang.Class clazz)
public static boolean isObjectArray(java.lang.Object object)
clazz
- The object to be checked
Result
True if the given object is an array of objects.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |