Collection of static methods for operations on arrays
|Method from org.hsqldb.lib.ArrayUtil Detail:|
public static void copyAdjustArray(Object source,
Copies elements of source to dest. If adjust is -1 the element at
colindex is not copied. If adjust is +1 that element is filled with
the Object addition. All the rest of the elements in source are
shifted left or right accordingly when they are copied.
No checks are perfomed on array sizes and an exception is thrown
if they are not consistent with the other arguments.
public static void copyArray(int source,
public static void copyColumnValues(Object row,
Copies some elements of row into colobject by using colindex as the
list of indexes into row. colindex and colobject are of equal length
and normally shorter than row;
public static int getAdjustedColumnArray(int colarr,
Convenience wrapper for toAdjustedColumnArray() that creates the new
public static boolean haveCommonElement(int a,
Checks for any overlap between two arrays of column indexes.
Limit check to lenb elements of b
public static boolean haveEqualArrays(int a,
Returns true if the first count elements of a and b are identical
subarrays of integers
public static boolean haveEqualSets(int a,
Returns true if the first count elements of a and b are identical sets
public static boolean haveEquality(int a,
For sets == true returns true if a and b are the same length and
contain the same set of integers. For sets == false returns the result
public static void sortArray(int intarr)
Basic sort for small arrays.
public static int toAdjustedColumnArray(int colarr,
Returns new array with the elements in collar ajusted to reflect
changes at colindex.
Each element in collarr represents an index into another array
colindex is the index at which an element is added or removed form
otherarr. Each element in the result array represents the new,
adjusted index to otherarr.
For each element of collarr that represents an index equal to
colindex and adjust is -1, the result will not contain that element
and will be shorter than collar by one element.