|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.core.ArrayUtil
public final class ArrayUtil
Array Utilities. These are helper functions for dealing with arrays.
| Method Summary | |
|---|---|
static Object[] |
append(Object[] in,
Object a)
Helper function to append an Object to an array and return the new array. |
static Object[] |
array()
Helper function to create a new empty Object array |
static Object[] |
array(List vector)
Convert a List into an Object array with null check. |
static Object[] |
array(Object a)
Helper function to create a new Object array containing one Object. |
static Object[] |
array(Object a,
Object b)
Helper function to create a new Object array containing two Objects. |
static Object[] |
array(Object a,
Object b,
Object c)
Helper function to create a new Object array containing three Objects. |
static Object[] |
array(Object a,
Object b,
Object c,
Object d)
Helper function to create a new Object array containing four Objects. |
static Object[] |
array(Object a,
Object b,
Object c,
Object d,
Object e)
Helper function to create a new Object array containing five Objects. |
static Object[] |
array(Object a,
Object b,
Object c,
Object d,
Object e,
Object f)
Helper function to create a new Object array containing six Objects. |
static Object[] |
array(Object a,
Object b,
Object c,
Object d,
Object e,
Object f,
Object g)
Helper function to create a new Object array containing seven Objects. |
static Object[] |
array(Object a,
Object b,
Object c,
Object d,
Object e,
Object f,
Object g,
Object h)
Helper function to create a new Object array containing eight Objects. |
static boolean |
arrayEquals(Object[] a1,
Object[] a2)
Determines if the two arrays are equal Two arrays are equal if their size is identical and if for each position in the array, both corresponding elements are equal |
static boolean |
contains(Object[] array,
Object x)
Check if the array contains an object. |
static boolean |
containsIdentical(Object[] array,
Object x)
Check if the array contains an object. |
static String |
formatArray(String header,
String[] args)
Returns a String with the array printed as formatted text |
static int |
indexOf(Object[] array,
Object x)
Find the location of an object in the array Object.equals() is used to compare objects. |
static boolean |
nullOrEmptyArray(Object[] array)
Determine if an Object array is null or empty. |
static boolean |
nullOrEmptyIntArray(int[] array)
Determine if an int array is null or empty. |
static Object[] |
prepend(Object a,
Object[] in)
Helper function to prepend an Object to an array and return the new array. |
static void |
printArray(PrintStream out,
String head,
String[] args)
Write an array into a PrintStream. |
static void |
reverse(Object[] objects)
Reverses the order of the objects in this array. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Object[] array(List vector)
vector - a List to pull the contents from
public static Object[] array()
public static Object[] array(Object a)
a - the first Object to add to the List
public static Object[] array(Object a,
Object b)
a - the first Object to add to the Listb - the second Object to add to the List
public static Object[] array(Object a,
Object b,
Object c)
a - the first Object to add to the Listb - the second Object to add to the Listc - the third Object to add to the List
public static Object[] array(Object a,
Object b,
Object c,
Object d)
a - the first Object to add to the Listb - the second Object to add to the Listc - the third Object to add to the Listd - the fourth Object to add to the List
public static Object[] array(Object a,
Object b,
Object c,
Object d,
Object e)
a - the first Object to add to the Listb - the second Object to add to the Listc - the third Object to add to the Listd - the fourth Object to add to the Liste - the fifth Object to add to the List
public static Object[] array(Object a,
Object b,
Object c,
Object d,
Object e,
Object f)
a - the first Object to add to the Listb - the second Object to add to the Listc - the third Object to add to the Listd - the fourth Object to add to the Liste - the fifth Object to add to the Listf - the sixth Object to add to the List
public static Object[] array(Object a,
Object b,
Object c,
Object d,
Object e,
Object f,
Object g)
a - the first Object to add to the Listb - the second Object to add to the Listc - the third Object to add to the Listd - the fourth Object to add to the Liste - the fifth Object to add to the Listf - the sixth Object to add to the Listg - the seventh Object to add to the List
public static Object[] array(Object a,
Object b,
Object c,
Object d,
Object e,
Object f,
Object g,
Object h)
a - the first Object to add to the Listb - the second Object to add to the Listc - the third Object to add to the Listd - the fourth Object to add to the Liste - the fifth Object to add to the Listf - the sixth Object to add to the Listg - the seventh Object to add to the Listh - the eighth Object to add to the List
public static Object[] prepend(Object a,
Object[] in)
a - the Object to be prependedin - the array to prepend a onto
public static Object[] append(Object[] in,
Object a)
in - the array to prepend a ontoa - the Object to be appended
public static boolean nullOrEmptyArray(Object[] array)
array - the Object array to check
public static boolean nullOrEmptyIntArray(int[] array)
array - the int array to check
public static void printArray(PrintStream out,
String head,
String[] args)
out - a PrintStream to write the output tohead - a header to prefix the list withargs - the array of Strings to printformatArray(String, String[])
public static String formatArray(String header,
String[] args)
header - a header to prefix the list withargs - the array of Strings to print
public static boolean containsIdentical(Object[] array,
Object x)
array - the array to checkx - the object to check for
public static boolean contains(Object[] array,
Object x)
array - the array to checkx - the object to check for
public static int indexOf(Object[] array,
Object x)
array - the array to checkx - The object to look for
public static boolean arrayEquals(Object[] a1,
Object[] a2)
a1 - first arraya2 - second array
true if the two arrays are equalpublic static void reverse(Object[] objects)
objects - the object array
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||