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
ABytesRefsorter tries to use a efficient radix sorter ifcmpis 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 classStringSorter.MSBStringRadixSorterA radix sorter forBytesRef
-
Field Summary
Fields Modifier and Type Field Description protected BytesRefpivotprotected BytesRefBuilderpivotBuilderprotected BytesRefBuilderscratch1protected BytesRefBuilderscratch2protected BytesRefscratchBytes1protected BytesRefscratchBytes2
-
Constructor Summary
Constructors Modifier Constructor Description protectedStringSorter(Comparator<BytesRef> cmp)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intcompare(int i, int j)Compare entries found in slotsiandj.protected SorterfallbackSorter(Comparator<BytesRef> cmp)protected abstract voidget(BytesRefBuilder builder, BytesRef result, int i)protected SorterradixSorter(BytesRefComparator cmp)voidsort(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:SorterCompare entries found in slotsiandj. 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:SorterSort the slice which starts atfrom(inclusive) and ends atto(exclusive).
-
radixSorter
protected Sorter radixSorter(BytesRefComparator cmp)
-
fallbackSorter
protected Sorter fallbackSorter(Comparator<BytesRef> cmp)
-
-