goldman.collection.ordered.digitized
Interface TrieNode<E>

All Known Subinterfaces:
CompressedTrieNode<E>, TrieLeafNode<E>
All Known Implementing Classes:
AbstractTrieLeafNode, AbstractTrieNode, CompressedTrie.InternalNode, CompressedTrie.LeafNode, PatriciaTrie.Node, TernarySearchTrie.InternalNode, Trie.InternalNode, Trie.LeafNode

public interface TrieNode<E>

The TrieNode interface must be supported by any class defining objects to be used as nodes in a trie.


Method Summary
 TrieNode<E> child(int i)
          Returns a reference to the ith child.
 E data()
          Returns the data (if any) associated with this trie node.
 boolean isLeaf()
          Returns true if and only if this trie node is a leaf.
 TrieNode<E> parent()
          Returns a reference to the parent (or null for the root).
 void setParent(TrieNode<E> parent)
          Sets the parent reference to be the given trie node.
 

Method Detail

child

TrieNode<E> child(int i)
Returns a reference to the ith child.


data

E data()
Returns the data (if any) associated with this trie node. All data elements are held in leaf nodes, but for some trie implementations the internal nodes hold a reference to an element that begins with the common prefix shared by all of its descendants.


isLeaf

boolean isLeaf()
Returns true if and only if this trie node is a leaf.


parent

TrieNode<E> parent()
Returns a reference to the parent (or null for the root).


setParent

void setParent(TrieNode<E> parent)
Sets the parent reference to be the given trie node.