public interface KeyAnalyzer<K>
extends java.util.Comparator<K>
KeyAnalyzer
provides bit-level access to keys
for the PatriciaTrie
.Modifier and Type | Field and Description |
---|---|
static int |
EQUAL_BIT_KEY
Returned by
bitIndex(Object, Object) if a the
bits of two keys were all equal. |
static int |
NULL_BIT_KEY
Returned by
bitIndex(Object, Object) if a key's
bits were all zero (0). |
static int |
OUT_OF_BOUNDS_BIT_KEY
Returned by
bitIndex(Object, Object) if a keys
indices are out of bounds. |
Modifier and Type | Method and Description |
---|---|
int |
bitIndex(K key,
K otherKey)
Returns the index of the first bit that is different in the two keys.
|
boolean |
isBitSet(K key,
int bitIndex)
Returns
true if a key's bit it set at the given index. |
boolean |
isPrefix(K key,
K prefix)
Returns
true if the second argument is a
prefix of the first argument. |
int |
lengthInBits(K key)
Returns the key's length in bits.
|
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
static final int NULL_BIT_KEY
bitIndex(Object, Object)
if a key's
bits were all zero (0).static final int EQUAL_BIT_KEY
bitIndex(Object, Object)
if a the
bits of two keys were all equal.static final int OUT_OF_BOUNDS_BIT_KEY
bitIndex(Object, Object)
if a keys
indices are out of bounds.Copyright © 2009- The Apache Software Foundation