public abstract class BytesRefComparator extends Object implements Comparator<BytesRef>
BytesRef
comparator that
FixedLengthBytesRefArray.iterator(Comparator)
has optimizations
for.Modifier | Constructor and Description |
---|---|
protected |
BytesRefComparator(int comparedBytesCount)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
byteAt(BytesRef ref,
int i)
Return the unsigned byte to use for comparison at index
i , or
-1 if all bytes that are useful for comparisons are exhausted. |
int |
compare(BytesRef o1,
BytesRef o2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected BytesRefComparator(int comparedBytesCount)
comparedBytesCount
- the maximum number of bytes to compare.protected abstract int byteAt(BytesRef ref, int i)
i
, or
-1
if all bytes that are useful for comparisons are exhausted.
This may only be called with a value of i
between 0
included and comparedBytesCount
excluded.public int compare(BytesRef o1, BytesRef o2)
compare
in interface Comparator<BytesRef>
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.