goldman.collection.ordered.digitized
Class PatriciaTrie.PatriciaSearchData

java.lang.Object
  extended by goldman.collection.ordered.digitized.Trie.SearchData
      extended by goldman.collection.ordered.digitized.CompressedTrie.CompressedTrieSearchData
          extended by goldman.collection.ordered.digitized.PatriciaTrie.PatriciaSearchData
Enclosing class:
PatriciaTrie<E>

protected class PatriciaTrie.PatriciaSearchData
extends CompressedTrie.CompressedTrieSearchData


Constructor Summary
protected PatriciaTrie.PatriciaSearchData()
           
 
Method Summary
 boolean atLeaf()
           
 boolean atRoot()
           
protected  int moveDown(E element)
          Moves this search data instance down one level in the tree
protected  int moveDown(int childIndex)
           
protected  int moveUp()
          Moves the search location to the parent
 void retraceToLastLeftFork(E x)
          Moves the search location to the root of the left fork (if it exists) on the search path defined by x.
 
Methods inherited from class goldman.collection.ordered.digitized.CompressedTrie.CompressedTrieSearchData
numMatches
 
Methods inherited from class goldman.collection.ordered.digitized.Trie.SearchData
childIndex, extendPath, moveToMaxDescendant, processedEndOfString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatriciaTrie.PatriciaSearchData

protected PatriciaTrie.PatriciaSearchData()
Method Detail

atLeaf

public boolean atLeaf()
Overrides:
atLeaf in class Trie.SearchData
Returns:
true if and only if the search data object is currently at a leaf node.

atRoot

public boolean atRoot()
Overrides:
atRoot in class Trie.SearchData
Returns:
true if and only if the SearchData location is at the search root in its role as an internal node.

moveDown

protected int moveDown(int childIndex)
Overrides:
moveDown in class Trie.SearchData
Parameters:
childIndex - the index of the child to which to move
REQUIRES: childIndex is not 1 if ptr = root
Returns:
the index for convenience

moveDown

protected int moveDown(E element)
Moves this search data instance down one level in the tree

Overrides:
moveDown in class Trie.SearchData
Parameters:
element - the element defining the search path
Returns:
the index of the child to which the search data object has moved.

moveUp

protected int moveUp()
Moves the search location to the parent

Overrides:
moveUp in class Trie.SearchData
Returns:
the branch position for the new search location.

retraceToLastLeftFork

public void retraceToLastLeftFork(E x)
Moves the search location to the root of the left fork (if it exists) on the search path defined by x. If there is no left fork, then it moves the search location to the root.

Overrides:
retraceToLastLeftFork in class Trie.SearchData
Parameters:
x - the target
REQUIRES: this SearchData instance is already positioned by a call to find(x)