Class Sorter

java.lang.Object
org.apache.lucene.util.Sorter
Direct Known Subclasses:
InPlaceMergeSorter, IntroSorter, TimSorter

public abstract class Sorter extends Object
Base class for sorting algorithms implementations.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Sole constructor, used for inheritance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract int
    compare(int i, int j)
    Compare entries found in slots i and j.
    abstract void
    sort(int from, int to)
    Sort the slice which starts at from (inclusive) and ends at to (exclusive).
    protected abstract void
    swap(int i, int j)
    Swap values at slots i and j.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Sorter

      protected Sorter()
      Sole constructor, used for inheritance.
  • Method Details

    • compare

      protected abstract int compare(int i, int j)
      Compare entries found in slots i and j. The contract for the returned value is the same as Comparator.compare(Object, Object).
    • swap

      protected abstract void swap(int i, int j)
      Swap values at slots i and j.
    • sort

      public abstract void sort(int from, int to)
      Sort the slice which starts at from (inclusive) and ends at to (exclusive).