Module org.hsqldb
Package org.hsqldb.lib

## Class ArraySort

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

-     public final class ArraySort
      extends java.lang.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 Summary

    Constructors
    Constructor | Description
    --- | ---
    `ArraySort()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static int` | `deDuplicate​(java.lang.Object[] array, int limit, java.util.Comparator comparator)` |
    `static void` | `insertionSort​(java.lang.Object[] array, java.util.Comparator comparator, int lo0, int hi0)` |
    `static int` | `searchFirst​(java.lang.Object[] array, int start, int limit, java.lang.Object value, java.util.Comparator c)` | Returns the index of the lowest element == the given search target, or when not found, a negative value -(insert position + 1)
    `static void` | `sort​(java.lang.Object[] array, int limit, java.util.Comparator comparator)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ArraySort

          public ArraySort()

  - ### Method Detail

    - #### searchFirst

          public static int searchFirst​(java.lang.Object[] array,
                                        int start,
                                        int limit,
                                        java.lang.Object value,
                                        java.util.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​(java.lang.Object[] array,
                                        int limit,
                                        java.util.Comparator comparator)

    - #### sort

          public static void sort​(java.lang.Object[] array,
                                  int limit,
                                  java.util.Comparator comparator)

    - #### insertionSort

          public static void insertionSort​(java.lang.Object[] array,
                                           java.util.Comparator comparator,
                                           int lo0,
                                           int hi0)