|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface PatriciaTrie.KeyAnalyzer<K>
Defines the interface to analyze Trie
keys on a bit
level. KeyAnalyzer
's
methods return the length of the key in bits, whether or not a bit is
set, and bits per element in the key.
Additionally, a method determines if a key is a prefix of another key and returns the bit index where one key is different from another key (if the key and found key are equal than the return value is EQUAL_BIT_KEY).
KeyAnalyzer
defines:
NULL_BIT_KEY | When key's bits are all zero |
EQUAL_BIT_KEY | When keys are the same |
Field Summary | |
---|---|
static int |
EQUAL_BIT_KEY
Returned by bitIndex if key and found key are equal. |
static int |
NULL_BIT_KEY
Returned by bitIndex if key's bits are all 0 |
Method Summary | |
---|---|
int |
bitIndex(K key,
int keyStart,
int keyLength,
K found,
int foundStart,
int foundLength)
Returns the n-th different bit between key and found. |
int |
bitsPerElement()
Returns the number of bits per element in the key. |
boolean |
isBitSet(K key,
int keyLength,
int bitIndex)
Returns whether or not a bit is set |
boolean |
isPrefix(K prefix,
int offset,
int length,
K key)
Determines whether or not the given prefix (from offset to length) is a prefix of the given key. |
int |
length(K key)
Returns the length of the Key in bits. |
Methods inherited from interface java.util.Comparator |
---|
compare, equals |
Field Detail |
---|
static final int NULL_BIT_KEY
static final int EQUAL_BIT_KEY
Method Detail |
---|
int length(K key)
boolean isBitSet(K key, int keyLength, int bitIndex)
int bitIndex(K key, int keyStart, int keyLength, K found, int foundStart, int foundLength)
int bitsPerElement()
boolean isPrefix(K prefix, int offset, int length, K key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |