Package org.apache.lucene.util
Class BytesRefComparator
java.lang.Object
org.apache.lucene.util.BytesRefComparator
- All Implemented Interfaces:
Comparator<BytesRef>
Specialized
BytesRef
comparator that FixedLengthBytesRefArray.iterator(Comparator)
has optimizations for.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BytesRefComparator
(int comparedBytesCount) Sole constructor. -
Method Summary
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
-
Field Details
-
comparedBytesCount
final int comparedBytesCount
-
-
Constructor Details
-
BytesRefComparator
protected BytesRefComparator(int comparedBytesCount) Sole constructor.- Parameters:
comparedBytesCount
- the maximum number of bytes to compare.
-
-
Method Details
-
byteAt
Return the unsigned byte to use for comparison at indexi
, or-1
if all bytes that are useful for comparisons are exhausted. This may only be called with a value ofi
between0
included andcomparedBytesCount
excluded. -
compare
- Specified by:
compare
in interfaceComparator<BytesRef>
-