Module org.hsqldb

Class ArraySort

java.lang.Object
org.hsqldb.lib.ArraySort

public final class ArraySort extends Object
FastQSorts the [l,r] partition (inclusive) of the specified array of Rows, using the comparator.

Searches an ordered array.

Since:
1.9.0
Author:
Tony Lai (tony_lai@users dot sourceforge.net), Fred Toussi (fredt@users dot sourceforge.net)
  • Constructor Details

    • ArraySort

      public ArraySort()
  • Method Details

    • searchFirst

      public static int searchFirst(Object[] array, int start, int limit, Object value, Comparator 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[]
      start - int
      limit - int
      value - Object
      c - Comparator
      Returns:
      index or a negative value if not found
    • deDuplicate

      public static int deDuplicate(Object[] array, int limit, Comparator comparator)
    • sort

      public static void sort(Object[] array, int limit, Comparator comparator)
    • insertionSort

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