goldman.collection.ordered.digitized
Class TernarySearchTrie.InternalNode

java.lang.Object
  extended by goldman.collection.ordered.digitized.AbstractTrieNode<E>
      extended by goldman.collection.ordered.digitized.Trie.InternalNode
          extended by goldman.collection.ordered.digitized.TernarySearchTrie.InternalNode
All Implemented Interfaces:
TrieNode<E>
Enclosing class:
TernarySearchTrie<E>

protected class TernarySearchTrie.InternalNode
extends Trie.InternalNode


Method Summary
 int childIndex(E element, int bp)
           
 E data()
          Returns the data (if any) associated with this trie node.
 
Methods inherited from class goldman.collection.ordered.digitized.Trie.InternalNode
child, setChild
 
Methods inherited from class goldman.collection.ordered.digitized.AbstractTrieNode
isLeaf, parent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface goldman.collection.ordered.digitized.TrieNode
isLeaf, parent, setParent
 

Method Detail

data

public E data()
Description copied from interface: TrieNode
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.

Specified by:
data in interface TrieNode<E>
Overrides:
data in class AbstractTrieNode<E>
Returns:
the data associated with the LeafNode dataPtr

childIndex

public int childIndex(E element,
                      int bp)
Overrides:
childIndex in class Trie.InternalNode
Parameters:
element - the element with respect to the index of the appropriate child is sought
bp - the branch position of this node
Returns:
the index of the child followed by sp(element), assuming the current node has branch position bp