Module org.apache.lucene.core
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
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Comparator<? super T> (package private) TFields inherited from class org.apache.lucene.util.IntroSorter
SINGLE_MEDIAN_THRESHOLDFields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD, INSERTION_SORT_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompare(int i, int j) Compare entries found in slotsiandj.protected intcomparePivot(int j) Compare the pivot with the slot atj, similarly tocompare(i, j).protected voidsetPivot(int i) Save the value at slotiso that it can later be used as a pivot, seeSorter.comparePivot(int).protected voidswap(int i, int j) Swap values at slotsiandj.Methods inherited from class org.apache.lucene.util.IntroSorter
sort, sortMethods 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
-
Field Details
-
pivot
T pivot -
list
-
comp
-
-
Constructor Details
-
ListIntroSorter
ListIntroSorter(List<T> list, Comparator<? super T> comp)
-
-
Method Details
-
setPivot
protected void setPivot(int i) Description copied from class:SorterSave the value at slotiso that it can later be used as a pivot, seeSorter.comparePivot(int).- Specified by:
setPivotin classIntroSorter
-
swap
protected void swap(int i, int j) Description copied from class:SorterSwap values at slotsiandj. -
compare
protected int compare(int i, int j) Description copied from class:SorterCompare entries found in slotsiandj. The contract for the returned value is the same asComparator.compare(Object, Object).- Overrides:
comparein classIntroSorter
-
comparePivot
protected int comparePivot(int j) Description copied from class:SorterCompare the pivot with the slot atj, similarly tocompare(i, j).- Specified by:
comparePivotin classIntroSorter
-