Top Description Constructors Methods
org.hsqldb.lib

public final Class ArraySort

extends Object
Class Inheritance
Imports
java.util.Comparator

FastQSorts the [l,r] partition (inclusive) of the specified array of Rows, using the comparator.

Searches an ordered array.

Authors
Tony Lai (tony_lai@users dot sourceforge.net), Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.6.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int
deDuplicate(Object[] array, int limit, Comparator<T> comparator)

public static void
insertionSort(Object[] array, Comparator<T> comparator, int lo0, int hi0)

private static void
moveAndInsertRow(Object[] array, int i, int j)

private static void
moveRows(Object[] array, int fromIndex, int toIndex, int rows)

pack-priv static void
quickSort(Object[] array, Comparator<T> comparator, int l, int r)

public static int

Returns:

index or a negative value if not found
searchFirst
(Object[]
Object[]
array
,
int
int
start
,
int
int
limit
,
Object
Object
value
,
Comparator<T>
Comparator
c
)

Returns the index of the lowest element == the given search target, or when not found, a negative value -(insert position + 1)

public static void
sort(Object[] array, int limit, Comparator<T> comparator)

private static void
swap(Object[] array, int i1, int i2)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ArraySortback to summary
public ArraySort()

Method Detail

deDuplicateback to summary
public static int deDuplicate(Object[] array, int limit, Comparator<T> comparator)
insertionSortback to summary
public static void insertionSort(Object[] array, Comparator<T> comparator, int lo0, int hi0)
moveAndInsertRowback to summary
private static void moveAndInsertRow(Object[] array, int i, int j)
moveRowsback to summary
private static void moveRows(Object[] array, int fromIndex, int toIndex, int rows)
quickSortback to summary
pack-priv static void quickSort(Object[] array, Comparator<T> comparator, int l, int r)
searchFirstback to summary
public static int searchFirst(Object[] array, int start, int limit, Object value, Comparator<T> c)

Returns the index of the lowest element == the given search target, or when not found, a negative value -(insert position + 1)

Parameters
array:Object[]

Object[]

start:int

int

limit:int

int

value:Object

Object

c:Comparator<T>

Comparator

Returns:int

index or a negative value if not found

sortback to summary
public static void sort(Object[] array, int limit, Comparator<T> comparator)
swapback to summary
private static void swap(Object[] array, int i1, int i2)