goldman.collection.ordered.digitized
Class PatriciaTrie.Node

java.lang.Object
  extended by goldman.collection.ordered.digitized.AbstractTrieNode<E>
      extended by goldman.collection.ordered.digitized.AbstractTrieLeafNode<E>
          extended by goldman.collection.ordered.digitized.Trie.LeafNode
              extended by goldman.collection.ordered.digitized.CompressedTrie.LeafNode
                  extended by goldman.collection.ordered.digitized.PatriciaTrie.Node
All Implemented Interfaces:
CompressedTrieNode<E>, TrieLeafNode<E>, TrieNode<E>
Enclosing class:
PatriciaTrie<E>

protected class PatriciaTrie.Node
extends CompressedTrie.LeafNode
implements CompressedTrieNode<E>, TrieLeafNode<E>


Method Summary
 int bp()
          Returns the position of the digit used for branching at this node.
 TrieNode<E> child(int i)
          Returns a reference to the ith child.
 int childIndex(E element, int bp)
           
 
Methods inherited from class goldman.collection.ordered.digitized.Trie.LeafNode
data, toString
 
Methods inherited from class goldman.collection.ordered.digitized.AbstractTrieLeafNode
addAfter, isDeleted, isLeaf, markDeleted, next, prev, remove, setNext, setPrev
 
Methods inherited from class goldman.collection.ordered.digitized.AbstractTrieNode
parent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface goldman.collection.ordered.digitized.TrieNode
data, isLeaf, parent, setParent
 
Methods inherited from interface goldman.collection.ordered.digitized.TrieLeafNode
addAfter, isDeleted, markDeleted, next, prev, remove, setNext, setPrev
 
Methods inherited from interface goldman.collection.ordered.digitized.TrieNode
data, isLeaf, parent, setParent
 

Method Detail

bp

public int bp()
Description copied from interface: CompressedTrieNode
Returns the position of the digit used for branching at this node.

Specified by:
bp in interface CompressedTrieNode<E>
Overrides:
bp in class CompressedTrie.LeafNode
Returns:
the branch position for the node

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 child index sought
bp - the branch position of this node
Returns:
the index of the child determined by sp(element) when this node has branch position bp