Package org.apache.lucene.util
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
Sorter()
Sole constructor, used for inheritance.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract int
compare(int i, int j)
Compare entries found in slotsi
andj
.abstract void
sort(int from, int to)
Sort the slice which starts atfrom
(inclusive) and ends atto
(exclusive).protected abstract void
swap(int i, int j)
Swap values at slotsi
andj
.
-
-
-
Method Detail
-
compare
protected abstract int compare(int i, int j)
Compare entries found in slotsi
andj
. The contract for the returned value is the same asComparator.compare(Object, Object)
.
-
swap
protected abstract void swap(int i, int j)
Swap values at slotsi
andj
.
-
sort
public abstract void sort(int from, int to)
Sort the slice which starts atfrom
(inclusive) and ends atto
(exclusive).
-
-