edu.wisc.ssec.mcidasv.util.trie
Class AddeEntryKeyAnalyzer

java.lang.Object
  extended by 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
           
 
Fields inherited from interface edu.wisc.ssec.mcidasv.util.trie.PatriciaTrie.KeyAnalyzer
EQUAL_BIT_KEY, NULL_BIT_KEY
 
Constructor Summary
AddeEntryKeyAnalyzer()
           
 
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
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

logger

static final org.slf4j.Logger logger
Constructor Detail

AddeEntryKeyAnalyzer

public AddeEntryKeyAnalyzer()
Method Detail

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)