Package org.apache.lucene.util
Class BytesRefComparator
- java.lang.Object
-
- org.apache.lucene.util.BytesRefComparator
-
- All Implemented Interfaces:
Comparator<BytesRef>
public abstract class BytesRefComparator extends Object implements Comparator<BytesRef>
SpecializedBytesRefcomparator thatSortableBytesRefArray.iterator(Comparator)has optimizations for.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBytesRefComparator(int comparedBytesCount)Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract intbyteAt(BytesRef ref, int i)Return the unsigned byte to use for comparison at indexi, or-1if all bytes that are useful for comparisons are exhausted.intcompare(BytesRef o1, BytesRef o2)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
byteAt
protected abstract int byteAt(BytesRef ref, int i)
Return the unsigned byte to use for comparison at indexi, or-1if all bytes that are useful for comparisons are exhausted. This may only be called with a value ofibetween0included andcomparedBytesCountexcluded.
-
compare
public int compare(BytesRef o1, BytesRef o2)
- Specified by:
comparein interfaceComparator<BytesRef>
-
-