private static final class CollectionUtil.ListIntroSorter<T> extends IntroSorter
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.Comparator<? super T> |
comp |
(package private) java.util.List<T> |
list |
(package private) T |
pivot |
BINARY_SORT_THRESHOLD| Constructor and Description |
|---|
ListIntroSorter(java.util.List<T> list,
java.util.Comparator<? super T> comp) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
compare(int i,
int j)
Compare entries found in slots
i and j. |
protected int |
comparePivot(int j)
Compare the pivot with the slot at
j, similarly to
compare(i, j). |
protected void |
setPivot(int i)
Save the value at slot
i so that it can later be used as a
pivot, see Sorter.comparePivot(int). |
protected void |
swap(int i,
int j)
Swap values at slots
i and j. |
quicksort, sortbinarySort, binarySort, checkRange, doRotate, heapChild, heapify, heapParent, heapSort, lower, lower2, mergeInPlace, reverse, rotate, siftDown, upper, upper2T pivot
final java.util.List<T> list
final java.util.Comparator<? super T> comp
protected void setPivot(int i)
Sorteri so that it can later be used as a
pivot, see Sorter.comparePivot(int).setPivot in class IntroSorterprotected void swap(int i,
int j)
Sorteri and j.protected int compare(int i,
int j)
Sorteri and j.
The contract for the returned value is the same as
Comparator.compare(Object, Object).compare in class IntroSorterprotected int comparePivot(int j)
Sorterj, similarly to
compare(i, j).comparePivot in class IntroSorter