|
|||||||||
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 java.lang.Object[] |
append(java.lang.Object[] in,
java.lang.Object a)
Helper function to append an Object to an array and return the new array. |
static java.lang.Object[] |
array()
Helper function to create a new empty Object array |
static java.lang.Object[] |
array(java.util.List vector)
Convert a List into an Object array with null check. |
static java.lang.Object[] |
array(java.lang.Object a)
Helper function to create a new Object array containing one Object. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b)
Helper function to create a new Object array containing two Objects. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b,
java.lang.Object c)
Helper function to create a new Object array containing three Objects. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d)
Helper function to create a new Object array containing four Objects. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e)
Helper function to create a new Object array containing five Objects. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e,
java.lang.Object f)
Helper function to create a new Object array containing six Objects. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e,
java.lang.Object f,
java.lang.Object g)
Helper function to create a new Object array containing seven Objects. |
static java.lang.Object[] |
array(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e,
java.lang.Object f,
java.lang.Object g,
java.lang.Object h)
Helper function to create a new Object array containing eight Objects. |
static boolean |
arrayEquals(java.lang.Object[] a1,
java.lang.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(java.lang.Object[] array,
java.lang.Object x)
Check if the array contains an object. |
static boolean |
containsIdentical(java.lang.Object[] array,
java.lang.Object x)
Check if the array contains an object. |
static java.lang.String |
formatArray(java.lang.String header,
java.lang.String[] args)
Returns a String with the array printed as formatted text |
static int |
indexOf(java.lang.Object[] array,
java.lang.Object x)
Find the location of an object in the array Object.equals() is used to compare objects. |
static boolean |
nullOrEmptyArray(java.lang.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 java.lang.Object[] |
prepend(java.lang.Object a,
java.lang.Object[] in)
Helper function to prepend an Object to an array and return the new array. |
static void |
printArray(java.io.PrintStream out,
java.lang.String head,
java.lang.String[] args)
Write an array into a PrintStream. |
static void |
reverse(java.lang.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 java.lang.Object[] array(java.util.List vector)
vector
- a List to pull the contents from
public static java.lang.Object[] array()
public static java.lang.Object[] array(java.lang.Object a)
a
- the first Object to add to the List
public static java.lang.Object[] array(java.lang.Object a, java.lang.Object b)
a
- the first Object to add to the Listb
- the second Object to add to the List
public static java.lang.Object[] array(java.lang.Object a, java.lang.Object b, java.lang.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 java.lang.Object[] array(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.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 java.lang.Object[] array(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.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 java.lang.Object[] array(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e, java.lang.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 java.lang.Object[] array(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e, java.lang.Object f, java.lang.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 java.lang.Object[] array(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e, java.lang.Object f, java.lang.Object g, java.lang.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 java.lang.Object[] prepend(java.lang.Object a, java.lang.Object[] in)
a
- the Object to be prependedin
- the array to prepend a onto
public static java.lang.Object[] append(java.lang.Object[] in, java.lang.Object a)
in
- the array to prepend a ontoa
- the Object to be appended
public static boolean nullOrEmptyArray(java.lang.Object[] array)
array
- the Object array to check
public static boolean nullOrEmptyIntArray(int[] array)
array
- the int array to check
public static void printArray(java.io.PrintStream out, java.lang.String head, java.lang.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 java.lang.String formatArray(java.lang.String header, java.lang.String[] args)
header
- a header to prefix the list withargs
- the array of Strings to print
public static boolean containsIdentical(java.lang.Object[] array, java.lang.Object x)
array
- the array to checkx
- the object to check for
public static boolean contains(java.lang.Object[] array, java.lang.Object x)
array
- the array to checkx
- the object to check for
public static int indexOf(java.lang.Object[] array, java.lang.Object x)
array
- the array to checkx
- The object to look for
public static boolean arrayEquals(java.lang.Object[] a1, java.lang.Object[] a2)
a1
- first arraya2
- second array
true
if the two arrays are equalpublic static void reverse(java.lang.Object[] objects)
objects
- the object array
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |