|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ca.commons.cbutil.CBArray
Utility class for array operations. Not particularly fast - most operations implemented as linear searches. XXX most of these may be redundant - see java 'util.Array' class...
| Constructor Summary | |
CBArray()
|
|
| Method Summary | |
static java.util.Enumeration |
arrayToEnumeration(java.lang.Object[] o)
|
static boolean |
contains(java.lang.Object[] array,
java.lang.Object o)
Returns true if the passed object is not null, and is equal to (at least one) element of the array. |
static java.lang.Object[] |
difference(java.lang.Object[] a,
java.lang.Object[] b)
Returns the list of elements that appear in a but not in b. |
static java.lang.Object[] |
enumerationToArray(java.util.Enumeration e)
|
static java.lang.Object[] |
intersection(java.lang.Object[] a,
java.lang.Object[] b)
Returns the list of elements that appear in both of the passed arrays. |
static boolean |
isOrderedEqual(java.lang.Object[] a,
java.lang.Object[] b)
Returns true if arrays have the same elements, in the same order. |
static boolean |
isUnorderedEqual(java.lang.Object[] a,
java.lang.Object[] b)
Returns true if arrays have the same elements, in any order. |
static void |
print(java.lang.Object[] array)
Prints an array, using 'toString()' on each component. |
static java.lang.Object[] |
trimNulls(java.lang.Object[] o)
|
static java.lang.Object[] |
union(java.lang.Object[] a,
java.lang.Object[] b)
Returns the list of elements that appear at least once in one of the passed arrays. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CBArray()
| Method Detail |
public static java.lang.Object[] union(java.lang.Object[] a,
java.lang.Object[] b)
a - the first array to unioniseb - the second array to unionise.
public static java.lang.Object[] difference(java.lang.Object[] a,
java.lang.Object[] b)
a - the primary arrayb - the array to 'subtract'.
public static java.lang.Object[] intersection(java.lang.Object[] a,
java.lang.Object[] b)
a - the first array to unioniseb - the second array to unionise.
public static boolean isOrderedEqual(java.lang.Object[] a,
java.lang.Object[] b)
public static boolean isUnorderedEqual(java.lang.Object[] a,
java.lang.Object[] b)
public static boolean contains(java.lang.Object[] array,
java.lang.Object o)
array - the array that may contain the object.o - the object to check the existence of.public static void print(java.lang.Object[] array)
public static java.lang.Object[] enumerationToArray(java.util.Enumeration e)
public static java.util.Enumeration arrayToEnumeration(java.lang.Object[] o)
public static java.lang.Object[] trimNulls(java.lang.Object[] o)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||