edu.wisc.ssec.mcidasv.util.trie
Class PatriciaTrie.TrieEntry<K,V>

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.util.trie.PatriciaTrie.TrieEntry<K,V>
All Implemented Interfaces:
Serializable, Map.Entry<K,V>
Enclosing class:
PatriciaTrie<K,V>

private static class PatriciaTrie.TrieEntry<K,V>
extends Object
implements Map.Entry<K,V>, Serializable

The actual Trie nodes.


Field Summary
private  int bitIndex
          The index this entry is comparing.
private  K key
           
private  PatriciaTrie.TrieEntry<K,V> left
          The left child of this entry.
private  PatriciaTrie.TrieEntry<K,V> parent
          The parent of this entry.
private  PatriciaTrie.TrieEntry<K,V> predecessor
          The entry who uplinks to this entry.
private  PatriciaTrie.TrieEntry<K,V> right
          The right child of this entry.
private static long serialVersionUID
           
private  V value
           
 
Constructor Summary
private PatriciaTrie.TrieEntry(K key, V value, int bitIndex)
           
 
Method Summary
 boolean equals(Object o)
           
 K getKey()
           
 V getValue()
           
 boolean isEmpty()
          Whether or not the entry is storing a key.
private  boolean isExternalNode()
          Either the left or right child is a loopback
private  boolean isInternalNode()
          Neither the left nor right child is a loopback
private  V setKeyValue(K key, V value)
          Replaces the old key and value with the new ones.
 V setValue(V value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

key

private K key

value

private V value

bitIndex

private int bitIndex
The index this entry is comparing.


parent

private PatriciaTrie.TrieEntry<K,V> parent
The parent of this entry.


left

private PatriciaTrie.TrieEntry<K,V> left
The left child of this entry.


right

private PatriciaTrie.TrieEntry<K,V> right
The right child of this entry.


predecessor

private PatriciaTrie.TrieEntry<K,V> predecessor
The entry who uplinks to this entry.

Constructor Detail

PatriciaTrie.TrieEntry

private PatriciaTrie.TrieEntry(K key,
                               V value,
                               int bitIndex)
Method Detail

equals

public boolean equals(Object o)
Specified by:
equals in interface Map.Entry<K,V>
Overrides:
equals in class Object

isEmpty

public boolean isEmpty()
Whether or not the entry is storing a key. Only the root can potentially be empty, all other nodes must have a key.


getKey

public K getKey()
Specified by:
getKey in interface Map.Entry<K,V>

getValue

public V getValue()
Specified by:
getValue in interface Map.Entry<K,V>

setValue

public V setValue(V value)
Specified by:
setValue in interface Map.Entry<K,V>

setKeyValue

private V setKeyValue(K key,
                      V value)
Replaces the old key and value with the new ones. Returns the old vlaue.


isInternalNode

private boolean isInternalNode()
Neither the left nor right child is a loopback


isExternalNode

private boolean isExternalNode()
Either the left or right child is a loopback


toString

public String toString()
Overrides:
toString in class Object