All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.toolkit.util.ArrayUtils

java.lang.Object
   |
   +----com.ibm.eou.toolkit.util.ArrayUtils

public class ArrayUtils
extends Object
This class provides array utility functions.


Variable Index

 o DIFFERENCE
Constant representing the difference between two arrays.
 o INTERSECTION
Constant representing the intersection between two arrays.
 o SYMMETRIC_DIFFERENCE
Constant representing the symmetric difference between two arrays.
 o UNION
Constant representing the union between two arrays.

Method Index

 o addElement(Object, Object[], Object[])
Add the specified object to the end of the source array.
 o combine(char[], char[], int)
Return an array which is the result of the specified operation upon the two given arrays.
 o compressArray(byte[], int)
Compress the array by creating an index of distinct multi-byte values with the given size, which must divide the array length exactly.
 o copy(char[], int, char[], int, char[], boolean)
Copy elements from the source array to the target array, beginning at the specified positions in each array.
 o deflate(byte[], int)
Deflate the byte array using the specified compression of the Deflater class.
 o expandArray(byte[])
Recover the original array from the specified compressedArray as obtained from the compressArray method.
 o indexOf(boolean[], boolean)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(boolean[], boolean, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(byte[], byte)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(byte[], byte, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(char[], char)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(char[], char, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(double[], double)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(double[], double, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(float[], float)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(float[], float, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(int[], int)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(int[], int, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(long[], long)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(long[], long, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(Object[], Object)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(Object[], Object, boolean)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(Object[], Object, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(Object[], Object, int, boolean)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(short[], short)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.
 o indexOf(short[], short, int)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.
 o inflate(byte[])
Inflate the byte array using the Inflater class.
 o readAsInt(byte[], int, int)
Read the specified number of bytes from the byte array as an int, and return the int read.
 o removeElement(Object, Object[], Object[])
Remove the supplied object from the source array.
 o writeAsBytes(byte[], int, int, int)
Write an int as the specified number of bytes into the byte array, and return that number of bytes.

Variables

 o DIFFERENCE
 public static final int DIFFERENCE
Constant representing the difference between two arrays. This consists of all the items which are elements of the first array and not elements of the second array.

 o UNION
 public static final int UNION
Constant representing the union between two arrays. This consists of all the items which are elements of the first array or elements of the second array.

 o INTERSECTION
 public static final int INTERSECTION
Constant representing the intersection between two arrays. This consists of all the items which are elements of both arrays.

 o SYMMETRIC_DIFFERENCE
 public static final int SYMMETRIC_DIFFERENCE
Constant representing the symmetric difference between two arrays. This consists of all the items which are elements of the first array only, or elements which are of the second array only.

Methods

 o combine
 public static char[] combine(char array1[],
                              char array2[],
                              int operation)
Return an array which is the result of the specified operation upon the two given arrays. The operation can be DIFFERENCE, UNION, INTERSECTION, or SYMMETRIC_DIFFERENCE. The result is undefined if either of the given arrays contain any elements more than once.

See Also:
DIFFERENCE, UNION, INTERSECTION, SYMMETRIC_DIFFERENCE
 o copy
 public static int copy(char source[],
                        int sourcePosition,
                        char target[],
                        int targetPosition,
                        char match[],
                        boolean excludeMatching)
Copy elements from the source array to the target array, beginning at the specified positions in each array. Only elements which are also found in the match array are copied, unless excludeMatching is true in which case only elements which do not match are copied. The number of elements which were copied is returned.

 o compressArray
 public static byte[] compressArray(byte source[],
                                    int gulpSize)
Compress the array by creating an index of distinct multi-byte values with the given size, which must divide the array length exactly. The returned array includes the index and the indexed entries, and the original array can be recovered by passing the returned array to the expandArray() method.

See Also:
expandArray
 o writeAsBytes
 public static int writeAsBytes(byte target[],
                                int targetIndex,
                                int bytesToWrite,
                                int intToWrite)
Write an int as the specified number of bytes into the byte array, and return that number of bytes. The int is written low byte first, high byte last.

 o readAsInt
 public static int readAsInt(byte source[],
                             int sourceIndex,
                             int bytesToRead)
Read the specified number of bytes from the byte array as an int, and return the int read. The int is read as low byte first, high byte last.

 o expandArray
 public static byte[] expandArray(byte compressedArray[])
Recover the original array from the specified compressedArray as obtained from the compressArray method.

See Also:
compressArray
 o deflate
 public static byte[] deflate(byte source[],
                              int compression)
Deflate the byte array using the specified compression of the Deflater class.

 o inflate
 public static byte[] inflate(byte source[]) throws DataFormatException
Inflate the byte array using the Inflater class.

Throws: DataFormatException
thrown if the data is not valid zip data.
 o indexOf
 public static int indexOf(Object array[],
                           Object searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null. The == operator is used to test equality.

 o indexOf
 public static int indexOf(Object array[],
                           Object searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null. The == operator is used to test equality.

 o indexOf
 public static int indexOf(Object array[],
                           Object searchValue,
                           boolean useEqualsMethod)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null. If useEqualsMethod is true, the equals() method is used to test equality. Otherwise, the == operator is used.

 o indexOf
 public static int indexOf(Object array[],
                           Object searchValue,
                           int startIndex,
                           boolean useEqualsMethod)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null. If useEqualsMethod is true, the equals() method is used to test equality. Otherwise, the == operator is used.

 o indexOf
 public static long indexOf(long array[],
                            long searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(long array[],
                           long searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(int array[],
                           int searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(int array[],
                           int searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(short array[],
                           short searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(short array[],
                           short searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(char array[],
                           char searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(char array[],
                           char searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(byte array[],
                           byte searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(byte array[],
                           byte searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(boolean array[],
                           boolean searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(boolean array[],
                           boolean searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(float array[],
                           float searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(float array[],
                           float searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(double array[],
                           double searchValue)
Return the index of the first element in the array which equals the given search value, or -1 if the search value is not found or if the array is null.

 o indexOf
 public static int indexOf(double array[],
                           double searchValue,
                           int startIndex)
Return the index of the first element in the array whose index is greater than or equal to the given starting index and which equals the given search value, or -1 if the search value is not found or if the array is null.

 o addElement
 public static Object[] addElement(Object object,
                                   Object sourceArray[],
                                   Object destinationArray[])
Add the specified object to the end of the source array. The destination array should be of the same type as the source array and have one more element.

 o removeElement
 public static Object[] removeElement(Object object,
                                      Object sourceArray[],
                                      Object destinationArray[])
Remove the supplied object from the source array. If the object is not found in the array the original array is returned. If the object is found it is removed from the array and a new array is created one element smaller than the source array with all elements of a higher index than the removed element moving down the array. The destination array should be of the same type as the source array and have one less element.


All Packages  Class Hierarchy  This Package  Previous  Next  Index