Package org.apache.lucene.util
Class CollectionUtil.ListIntroSorter<T>
- java.lang.Object
-
- org.apache.lucene.util.Sorter
-
- org.apache.lucene.util.IntroSorter
-
- org.apache.lucene.util.CollectionUtil.ListIntroSorter<T>
-
- Enclosing class:
- CollectionUtil
private static final class CollectionUtil.ListIntroSorter<T> extends IntroSorter
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Comparator<? super T>
comp
(package private) java.util.List<T>
list
(package private) T
pivot
-
Fields inherited from class org.apache.lucene.util.IntroSorter
SINGLE_MEDIAN_THRESHOLD
-
Fields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD, INSERTION_SORT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description ListIntroSorter(java.util.List<T> list, java.util.Comparator<? super T> comp)
-
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 int
comparePivot(int j)
Compare the pivot with the slot atj
, similarly tocompare(i, j)
.protected void
setPivot(int i)
Save the value at sloti
so that it can later be used as a pivot, seeSorter.comparePivot(int)
.protected void
swap(int i, int j)
Swap values at slotsi
andj
.-
Methods inherited from class org.apache.lucene.util.IntroSorter
sort, sort
-
Methods inherited from class org.apache.lucene.util.Sorter
binarySort, binarySort, checkRange, doRotate, heapChild, heapify, heapParent, heapSort, insertionSort, lower, lower2, mergeInPlace, reverse, rotate, siftDown, upper, upper2
-
-
-
-
Method Detail
-
setPivot
protected void setPivot(int i)
Description copied from class:Sorter
Save the value at sloti
so that it can later be used as a pivot, seeSorter.comparePivot(int)
.- Specified by:
setPivot
in classIntroSorter
-
swap
protected void swap(int i, int j)
Description copied from class:Sorter
Swap values at slotsi
andj
.
-
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)
.- Overrides:
compare
in classIntroSorter
-
comparePivot
protected int comparePivot(int j)
Description copied from class:Sorter
Compare the pivot with the slot atj
, similarly tocompare(i, j)
.- Specified by:
comparePivot
in classIntroSorter
-
-