|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jimmc.util.ArrayUtil
Utility methods for arrays.
Constructor Summary | |
ArrayUtil()
|
Method Summary | |
static int[] |
andNot(int[] a1,
int[] a2)
Given two sorted arrays of ints, return the list of all entries which are in the first array and not in the second. |
static java.lang.String[] |
andNot(java.lang.String[] a1,
java.lang.String[] a2)
Given two sorted arrays of strings, return the list of all entries which are in the first array and not in the second. |
static java.lang.String[] |
cat(java.lang.String[] a1,
java.lang.String[] a2)
Concatenate two string arrays into a new string array. |
static int[] |
randomArray(int n)
Get an array of randomly ordered ints. |
static java.lang.Object[] |
shuffle(java.lang.Object[] aa)
Shuffle an array in random order. |
static void |
shuffle(java.lang.String[] ss)
Shuffle an array of strings in place. |
static java.lang.String[] |
union(java.lang.String[] a1,
java.lang.String[] a2)
Take the union of two unsorted sets of strings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayUtil()
Method Detail |
public static java.lang.String[] cat(java.lang.String[] a1, java.lang.String[] a2)
public static java.lang.String[] union(java.lang.String[] a1, java.lang.String[] a2)
public static java.lang.String[] andNot(java.lang.String[] a1, java.lang.String[] a2)
a1
- All returned entries are from this list.a2
- No returned entries are in this list.public static int[] andNot(int[] a1, int[] a2)
a1
- All returned entries are from this list.a2
- No returned entries are in this list.public static int[] randomArray(int n)
n
- The size of the array.public static java.lang.Object[] shuffle(java.lang.Object[] aa)
public static void shuffle(java.lang.String[] ss)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |