public static final class RandomAccessData.UnsignedLexicographicalComparator extends Object implements Comparator<RandomAccessData>
Comparator that compares two byte arrays lexicographically. It compares
values as a list of unsigned bytes. The first pair of values that follow any common prefix,
or when one array is a prefix of the other, treats the shorter array as the lesser.
For example, [] < [0x01] < [0x01, 0x7F] < [0x01, 0x80] < [0x02] < POSITIVE INFINITY.
Note that a token type of positive infinity is supported and is greater than
all other RandomAccessData.
| Modifier and Type | Method and Description |
|---|---|
int |
commonPrefixLength(RandomAccessData o1,
RandomAccessData o2)
Compute the length of the common prefix of the two provided sets of bytes.
|
int |
compare(RandomAccessData o1,
RandomAccessData o2) |
int |
compare(RandomAccessData o1,
RandomAccessData o2,
int startOffset)
Compare the two sets of bytes starting at the given offset.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic int compare(RandomAccessData o1, RandomAccessData o2)
compare in interface Comparator<RandomAccessData>public int compare(RandomAccessData o1, RandomAccessData o2, int startOffset)
public int commonPrefixLength(RandomAccessData o1, RandomAccessData o2)
Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.