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

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.util.trie.StringListKeyAnalyzer
All Implemented Interfaces:
PatriciaTrie.KeyAnalyzer<List<String>>, Serializable, Comparator<List<String>>

public class StringListKeyAnalyzer
extends Object
implements PatriciaTrie.KeyAnalyzer<List<String>>

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface edu.wisc.ssec.mcidasv.util.trie.PatriciaTrie.KeyAnalyzer
EQUAL_BIT_KEY, NULL_BIT_KEY
 
Constructor Summary
StringListKeyAnalyzer()
           
 
Method Summary
 int bitIndex(List<String> key, int keyStart, int keyLength, List<String> 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(List<String> o1, List<String> o2)
           
 boolean isBitSet(List<String> key, int keyLength, int bitIndex)
          Returns whether or not a bit is set
 boolean isPrefix(List<String> prefix, int offset, int length, List<String> key)
          Determines whether or not the given prefix (from offset to length) is a prefix of the given key.
 int length(List<String> key)
          Returns the length of the Key in bits.
 
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
 

Constructor Detail

StringListKeyAnalyzer

public StringListKeyAnalyzer()
Method Detail

bitIndex

public int bitIndex(List<String> key,
                    int keyStart,
                    int keyLength,
                    List<String> 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<List<String>>

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<List<String>>

isBitSet

public boolean isBitSet(List<String> 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<List<String>>

isPrefix

public boolean isPrefix(List<String> prefix,
                        int offset,
                        int length,
                        List<String> 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<List<String>>

length

public int length(List<String> key)
Description copied from interface: PatriciaTrie.KeyAnalyzer
Returns the length of the Key in bits.

Specified by:
length in interface PatriciaTrie.KeyAnalyzer<List<String>>

compare

public int compare(List<String> o1,
                   List<String> o2)
Specified by:
compare in interface Comparator<List<String>>