Home » hsqldb_1_8_0_10 » org.hsqldb.lib » [javadoc | source]
org.hsqldb.lib
public class: ArrayUtil [javadoc | source]
java.lang.Object
   org.hsqldb.lib.ArrayUtil
Collection of static methods for operations on arrays
Method from org.hsqldb.lib.ArrayUtil Summary:
copyAdjustArray,   copyArray,   copyColumnValues,   getAdjustedColumnArray,   haveCommonElement,   haveEqualArrays,   haveEqualSets,   haveEquality,   sortArray,   toAdjustedColumnArray
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hsqldb.lib.ArrayUtil Detail:
 public static  void copyAdjustArray(Object[] source,
    Object[] dest,
    Object addition,
    int colindex,
    int adjust) 
    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,
    int[] dest,
    int count) 
 public static  void copyColumnValues(Object[] row,
    int[] colindex,
    Object[] colobject) 
    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,
    int size,
    int colindex,
    int adjust) 
    Convenience wrapper for toAdjustedColumnArray() that creates the new array.
 public static boolean haveCommonElement(int[] a,
    int[] b,
    int lenb) 
    Checks for any overlap between two arrays of column indexes. Limit check to lenb elements of b
 public static boolean haveEqualArrays(int[] a,
    int[] b,
    int count) 
    Returns true if the first count elements of a and b are identical subarrays of integers
 public static boolean haveEqualSets(int[] a,
    int[] b,
    int count) 
    Returns true if the first count elements of a and b are identical sets of integers
 public static boolean haveEquality(int[] a,
    int[] b,
    int count,
    boolean sets) 
    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 of haveEqualArrays(a,b,count)
 public static  void sortArray(int[] intarr) 
    Basic sort for small arrays.
 public static int[] toAdjustedColumnArray(int[] colarr,
    int colindex,
    int adjust) 
    Returns new array with the elements in collar ajusted to reflect changes at colindex. Each element in collarr represents an index into another array otherarr. 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.