|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.vignette.portal.util.ArrayUtils
Utility class providing a set of static methods to manipulate arrays.
| Constructor Summary | |
ArrayUtils()
|
|
| Method Summary | |
static int[] |
addElement(int[] array,
int value)
Returns a new array consisting of the new element added to the end of the original array. |
static int[] |
addElement(int[] array,
int value,
int position)
Returns a new array consisting of the supplied element inserted at the specified position in the integer array. |
static String[] |
addElement(String[] array,
String value)
Adds an element to the end of a String array. |
static boolean |
contains(int[] array,
int value)
Tests whether an integer array contains the given element. |
static boolean |
contains(Object[] array,
Object value)
Tests whether an array contains the given element, using Object.equals() |
static int[] |
intersectedArray(int[] a,
int[] b)
Return the intersection of two integer arrays, if they have any matching elements. |
static boolean |
intersects(int[] a,
int[] b)
Tests whether two integer arrays have any matching elements. |
static boolean |
isEmpty(int[] array)
Tests whether an integer array is empty. |
static boolean |
isEmpty(Object[] array)
Tests whether an Object array is empty. |
static int[] |
setToIntArray(Set set)
Converts a Set of Integer objects into an array of ints - the order returned by the set's iterator() method is used - meaning the order is dependent on the implementation of set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArrayUtils()
| Method Detail |
public static boolean contains(int[] array,
int value)
array - Name of the integer arrayvalue - Array element to test for
public static boolean contains(Object[] array,
Object value)
array - Name of the Object arrayvalue - Array element to test for
public static int[] addElement(int[] array,
int value)
array - Name of the integer arrayvalue - Element to be added to the array
public static int[] addElement(int[] array,
int value,
int position)
array - Name of the integer arrayvalue - Element to be added to the arrayposition - New element's index
public static String[] addElement(String[] array,
String value)
array - Name of the String arrayvalue - Element to be added to the arraypublic static boolean isEmpty(Object[] array)
array - Name of the Object arraypublic static boolean isEmpty(int[] array)
array - Name of the integer array
public static boolean intersects(int[] a,
int[] b)
a - First integer arrayb - Second integer array
public static int[] intersectedArray(int[] a,
int[] b)
Arrays.sort(int[]).a - First integer arrayb - Second integer arraypublic static int[] setToIntArray(Set set)
set.
Returns null if the input set was null or if it contained any non-Integer objects.set - The Set from which to derive an array of int.set of Integer Objects.
|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||