goldman.collection.ordered.digitized
Class Trie.InternalNode
java.lang.Object
goldman.collection.ordered.digitized.AbstractTrieNode<E>
goldman.collection.ordered.digitized.Trie.InternalNode
- All Implemented Interfaces:
- TrieNode<E>
- Direct Known Subclasses:
- CompressedTrie.InternalNode, TernarySearchTrie.InternalNode
- Enclosing class:
- Trie<E>
protected class Trie.InternalNode
- extends AbstractTrieNode<E>
- implements TrieNode<E>
Method Summary |
TrieNode<E> |
child(int i)
Returns a reference to the ith
child. |
int |
childIndex(E element,
int bp)
|
protected int |
setChild(TrieNode<E> child,
E element,
int bp)
Sets the associated child for element
to child . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
child
public TrieNode<E> child(int i)
- Description copied from interface:
TrieNode
- Returns a reference to the ith
child.
- Specified by:
child
in interface TrieNode<E>
- Overrides:
child
in class AbstractTrieNode<E>
- Parameters:
i
- the index for the desired child
- Returns:
- the ith child
- Throws:
IllegalArgumentException
- i is
not between 0 and childCapacity
-1 (inclusive).
childIndex
public int childIndex(E element,
int bp)
- Parameters:
element
- the element for
which the index of the child is soughtbp
- the
branch position of
the node on which this method is called
- Returns:
- the index for
the next node on the search path defined by
element
.
setChild
protected int setChild(TrieNode<E> child,
E element,
int bp)
- Sets the associated child for
element
to child
.
- Parameters:
child
- the new child to addelement
- the element defining the search path
for the childbp
- the branch position of
the node on which this method is called
REQUIRES:
child
is
not null.
- Returns:
- the index at which
child
is placed