- java.lang.Object
-
- org.apache.lucene.util.Sorter
-
- org.apache.lucene.util.InPlaceMergeSorter
-
- org.apache.lucene.util.ArrayInPlaceMergeSorter<T>
-
final class ArrayInPlaceMergeSorter<T> extends InPlaceMergeSorter
AnInPlaceMergeSorter
for object arrays.
-
-
Field Summary
Fields Modifier and Type Field Description private T[]
arr
private java.util.Comparator<? super T>
comparator
-
Fields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD, INSERTION_SORT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description ArrayInPlaceMergeSorter(T[] arr, java.util.Comparator<? super T> comparator)
Create a newArrayInPlaceMergeSorter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
compare(int i, int j)
Compare entries found in slotsi
andj
.protected void
swap(int i, int j)
Swap values at slotsi
andj
.-
Methods inherited from class org.apache.lucene.util.InPlaceMergeSorter
mergeSort, sort
-
Methods inherited from class org.apache.lucene.util.Sorter
binarySort, binarySort, checkRange, comparePivot, doRotate, heapChild, heapify, heapParent, heapSort, insertionSort, lower, lower2, mergeInPlace, reverse, rotate, setPivot, siftDown, upper, upper2
-
-
-
-
Constructor Detail
-
ArrayInPlaceMergeSorter
public ArrayInPlaceMergeSorter(T[] arr, java.util.Comparator<? super T> comparator)
Create a newArrayInPlaceMergeSorter
.
-
-
Method Detail
-
compare
protected int compare(int i, int j)
Description copied from class:Sorter
Compare entries found in slotsi
andj
. The contract for the returned value is the same asComparator.compare(Object, Object)
.
-
-