edu.wisc.ssec.mcidasv.util.trie
Class AddeEntryKeyAnalyzer
java.lang.Object
edu.wisc.ssec.mcidasv.util.trie.AddeEntryKeyAnalyzer
- All Implemented Interfaces:
- PatriciaTrie.KeyAnalyzer<AddeEntry>, Serializable, Comparator<AddeEntry>
public class AddeEntryKeyAnalyzer
- extends Object
- implements PatriciaTrie.KeyAnalyzer<AddeEntry>
- See Also:
- Serialized Form
Field Summary |
(package private) static org.slf4j.Logger |
logger
|
Method Summary |
int |
bitIndex(AddeEntry key,
int keyStart,
int keyLength,
AddeEntry 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. |
int |
compare(AddeEntry o1,
AddeEntry o2)
|
boolean |
isBitSet(AddeEntry key,
int keyLength,
int bitIndex)
Returns whether or not a bit is set |
boolean |
isPrefix(AddeEntry prefix,
int offset,
int length,
AddeEntry key)
Determines whether or not the given prefix (from offset to length)
is a prefix of the given key. |
int |
length(AddeEntry key)
Returns the length of the Key in bits. |
private static String |
valAtIdx(int idx,
AddeEntry e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
static final org.slf4j.Logger logger
AddeEntryKeyAnalyzer
public AddeEntryKeyAnalyzer()
bitIndex
public int bitIndex(AddeEntry key,
int keyStart,
int keyLength,
AddeEntry found,
int foundStart,
int foundLength)
- Description copied from interface:
PatriciaTrie.KeyAnalyzer
- Returns the n-th different bit between key and found.
This starts the comparison in key at 'keyStart' and goes
for 'keyLength' bits, and compares to the found key
starting at 'foundStart' and going for 'foundLength' bits.
- Specified by:
bitIndex
in interface PatriciaTrie.KeyAnalyzer<AddeEntry>
bitsPerElement
public int bitsPerElement()
- Description copied from interface:
PatriciaTrie.KeyAnalyzer
- Returns the number of bits per element in the key.
This is only useful for variable-length keys, such as Strings.
- Specified by:
bitsPerElement
in interface PatriciaTrie.KeyAnalyzer<AddeEntry>
isBitSet
public boolean isBitSet(AddeEntry key,
int keyLength,
int bitIndex)
- Description copied from interface:
PatriciaTrie.KeyAnalyzer
- Returns whether or not a bit is set
- Specified by:
isBitSet
in interface PatriciaTrie.KeyAnalyzer<AddeEntry>
isPrefix
public boolean isPrefix(AddeEntry prefix,
int offset,
int length,
AddeEntry key)
- Description copied from interface:
PatriciaTrie.KeyAnalyzer
- Determines whether or not the given prefix (from offset to length)
is a prefix of the given key.
- Specified by:
isPrefix
in interface PatriciaTrie.KeyAnalyzer<AddeEntry>
length
public int length(AddeEntry key)
- Description copied from interface:
PatriciaTrie.KeyAnalyzer
- Returns the length of the Key in bits.
- Specified by:
length
in interface PatriciaTrie.KeyAnalyzer<AddeEntry>
compare
public int compare(AddeEntry o1,
AddeEntry o2)
- Specified by:
compare
in interface Comparator<AddeEntry>
valAtIdx
private static String valAtIdx(int idx,
AddeEntry e)