goldman.collection.ordered.digitized
Class TernarySearchTrie.InternalNode
java.lang.Object
goldman.collection.ordered.digitized.AbstractTrieNode<E>
goldman.collection.ordered.digitized.Trie.InternalNode
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 soughtbp
- the
branch position of
this node
- Returns:
- the index of
the child followed by
sp(element)
, assuming the current node has
branch position bp