- java.lang.Object
-
- org.apache.lucene.util.Sorter
-
- org.apache.lucene.util.InPlaceMergeSorter
-
- Direct Known Subclasses:
ArrayInPlaceMergeSorter
,WordDelimiterFilter.OffsetSorter
,WordDelimiterGraphFilter.PositionSorter
public abstract class InPlaceMergeSorter extends Sorter
Sorter
implementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated). Small arrays are sorted with binary sort.This algorithm is stable. It's especially suited to sorting small lists where we'd rather optimize for avoiding allocating memory for this task. It performs well on lists that are already sorted.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD, INSERTION_SORT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description InPlaceMergeSorter()
Create a newInPlaceMergeSorter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
mergeSort(int from, int to)
void
sort(int from, int to)
Sort the slice which starts atfrom
(inclusive) and ends atto
(exclusive).-
Methods inherited from class org.apache.lucene.util.Sorter
binarySort, binarySort, checkRange, compare, comparePivot, doRotate, heapChild, heapify, heapParent, heapSort, insertionSort, lower, lower2, mergeInPlace, reverse, rotate, setPivot, siftDown, swap, upper, upper2
-
-
-
-
Constructor Detail
-
InPlaceMergeSorter
public InPlaceMergeSorter()
Create a newInPlaceMergeSorter
-
-