Package org.apache.lucene.util
Class CollectionUtil.ListTimSorter<T>
- java.lang.Object
-
- org.apache.lucene.util.Sorter
-
- org.apache.lucene.util.TimSorter
-
- org.apache.lucene.util.CollectionUtil.ListTimSorter<T>
-
- Enclosing class:
- CollectionUtil
private static final class CollectionUtil.ListTimSorter<T> extends TimSorter
-
-
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[]tmp-
Fields inherited from class org.apache.lucene.util.TimSorter
maxTempSlots, MIN_GALLOP, minRun, MINRUN, runEnds, stackSize, STACKSIZE, THRESHOLD, to
-
Fields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description ListTimSorter(java.util.List<T> list, java.util.Comparator<? super T> comp, int maxTempSlots)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcompare(int i, int j)Compare entries found in slotsiandj.protected intcompareSaved(int i, int j)Compare elementifrom the temporary storage with elementjfrom the slice to sort, similarly toSorter.compare(int, int).protected voidcopy(int src, int dest)Copy data from slotsrcto slotdest.protected voidrestore(int i, int j)Restore elementjfrom the temporary storage into sloti.protected voidsave(int i, int len)Save all elements between slotsiandi+leninto the temporary storage.protected voidswap(int i, int j)Swap values at slotsiandj.-
Methods inherited from class org.apache.lucene.util.TimSorter
doRotate, ensureInvariants, exhaustStack, lowerSaved, lowerSaved3, merge, mergeAt, mergeHi, mergeLo, minRun, nextRun, pushRunLen, reset, runBase, runEnd, runLen, setRunEnd, sort, upperSaved, upperSaved3
-
Methods inherited from class org.apache.lucene.util.Sorter
binarySort, binarySort, checkRange, comparePivot, heapChild, heapify, heapParent, heapSort, lower, lower2, mergeInPlace, reverse, rotate, setPivot, siftDown, upper, upper2
-
-
-
-
Method Detail
-
swap
protected void swap(int i, int j)Description copied from class:SorterSwap values at slotsiandj.
-
copy
protected void copy(int src, int dest)Description copied from class:TimSorterCopy data from slotsrcto slotdest.
-
save
protected void save(int i, int len)Description copied from class:TimSorterSave all elements between slotsiandi+leninto the temporary storage.
-
restore
protected void restore(int i, int j)Description copied from class:TimSorterRestore elementjfrom the temporary storage into sloti.
-
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).
-
compareSaved
protected int compareSaved(int i, int j)Description copied from class:TimSorterCompare elementifrom the temporary storage with elementjfrom the slice to sort, similarly toSorter.compare(int, int).- Specified by:
compareSavedin classTimSorter
-
-