public abstract class MSBRadixSorter extends Sorter
IntroSorter when the size
of the buckets to sort becomes small. It is NOT stable.
Worst-case memory usage is about 2.3 KB.| Modifier | Constructor and Description |
|---|---|
protected |
MSBRadixSorter(int maxLength)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
byteAt(int i,
int k)
Return the k-th byte of the entry at index
i, or -1 if
its length is less than or equal to k. |
protected int |
compare(int i,
int j)
Compare entries found in slots
i and j. |
protected Sorter |
getFallbackSorter(int k)
Get a fall-back sorter which may assume that the first k bytes of all compared strings are equal.
|
void |
sort(int from,
int to)
Sort the slice which starts at
from (inclusive) and ends at
to (exclusive). |
comparePivot, setPivot, swapprotected MSBRadixSorter(int maxLength)
maxLength - the maximum length of keys, pass Integer.MAX_VALUE if unknown.protected abstract int byteAt(int i,
int k)
i, or -1 if
its length is less than or equal to k. This may only be called
with a value of i between 0 included and
maxLength excluded.protected Sorter getFallbackSorter(int k)
protected final int compare(int i,
int j)
Sorteri and j.
The contract for the returned value is the same as
Comparator.compare(Object, Object).Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.