Package org.apache.lucene.util
Class StringSorter
- java.lang.Object
-
- org.apache.lucene.util.Sorter
-
- org.apache.lucene.util.StringSorter
-
public abstract class StringSorter extends Sorter
ABytesRef
sorter tries to use a efficient radix sorter ifcmp
is aBytesRefComparator
, otherwise fallback tofallbackSorter(java.util.Comparator<org.apache.lucene.util.BytesRef>)
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
StringSorter.MSBStringRadixSorter
A radix sorter forBytesRef
-
Field Summary
Fields Modifier and Type Field Description protected BytesRef
pivot
protected BytesRefBuilder
pivotBuilder
protected BytesRefBuilder
scratch1
protected BytesRefBuilder
scratch2
protected BytesRef
scratchBytes1
protected BytesRef
scratchBytes2
-
Constructor Summary
Constructors Modifier Constructor Description protected
StringSorter(Comparator<BytesRef> cmp)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
compare(int i, int j)
Compare entries found in slotsi
andj
.protected Sorter
fallbackSorter(Comparator<BytesRef> cmp)
protected abstract void
get(BytesRefBuilder builder, BytesRef result, int i)
protected Sorter
radixSorter(BytesRefComparator cmp)
void
sort(int from, int to)
Sort the slice which starts atfrom
(inclusive) and ends atto
(exclusive).-
Methods inherited from class org.apache.lucene.util.Sorter
comparePivot, setPivot, swap
-
-
-
-
Field Detail
-
scratch1
protected final BytesRefBuilder scratch1
-
scratch2
protected final BytesRefBuilder scratch2
-
pivotBuilder
protected final BytesRefBuilder pivotBuilder
-
scratchBytes1
protected final BytesRef scratchBytes1
-
scratchBytes2
protected final BytesRef scratchBytes2
-
pivot
protected final BytesRef pivot
-
-
Constructor Detail
-
StringSorter
protected StringSorter(Comparator<BytesRef> cmp)
-
-
Method Detail
-
get
protected abstract void get(BytesRefBuilder builder, BytesRef result, int i)
-
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)
.
-
sort
public void sort(int from, int to)
Description copied from class:Sorter
Sort the slice which starts atfrom
(inclusive) and ends atto
(exclusive).
-
radixSorter
protected Sorter radixSorter(BytesRefComparator cmp)
-
fallbackSorter
protected Sorter fallbackSorter(Comparator<BytesRef> cmp)
-
-