gshute.trees
Class SearchTree

java.lang.Object
  |
  +--gshute.trees.Tree
        |
        +--gshute.trees.SearchTree

public class SearchTree
extends Tree

A SearchTree is a binary tree that is organized for key searches.


Fields inherited from class gshute.trees.Tree
cursor, nodeConstructor, root, stringBuffer
 
Constructor Summary
SearchTree(java.lang.Class nc, java.util.Comparator c, Selector s)
          new SearchTree(nc, c, s) returns a new search tree that constructs nodes from class nc, uses c for key comparisons, and that uses s to select keys from data.
 
Method Summary
 void findKey(java.lang.Object k)
          t.findKey(k) moves the cursor of t to the last edge on the search path for k in t.
 java.util.Comparator getComparator()
          t.getComparator() returns the comparator used by t for key comparisons.
 Selector getKeySelector()
          t.getKeySelector() returns the selector that t uses to extract keys from data.
 
Methods inherited from class gshute.trees.Tree
add, addSubtreeString, containsNode, getCursor, getCursorTo, getInorderIterator, getPostorderIterator, getPreorderIterator, getRoot, isEmpty, remove, replace, rotateLeft, rotateRight, setRoot, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchTree

public SearchTree(java.lang.Class nc,
                  java.util.Comparator c,
                  Selector s)
new SearchTree(nc, c, s) returns a new search tree that constructs nodes from class nc, uses c for key comparisons, and that uses s to select keys from data.
Method Detail

getComparator

public java.util.Comparator getComparator()
t.getComparator() returns the comparator used by t for key comparisons.

getKeySelector

public Selector getKeySelector()
t.getKeySelector() returns the selector that t uses to extract keys from data.

findKey

public void findKey(java.lang.Object k)
t.findKey(k) moves the cursor of t to the last edge on the search path for k in t. If k is a key in t then the cursor to node of t has key k. If k is not a key in t then the cursor to node of t is null.