gshute.trees
Class SearchTreeTester

java.lang.Object
  |
  +--gshute.ioutil.Tester
        |
        +--gshute.trees.SearchTreeTester

public class SearchTreeTester
extends Tester

The SearchTreeTester class provides a main() method for testing the SearchTree class with various types of tree nodes.


Field Summary
protected  SearchTree theTree
          theTree is the SearchTree that is being tested by this SearchTreeTester.
 
Fields inherited from class gshute.ioutil.Tester
commandStream, commandTable, prompt
 
Constructor Summary
SearchTreeTester()
           
 
Method Summary
 void addCommands()
          addCommands() adds testing commands to the command table.
static void main(java.lang.String[] args)
          Program synopsis:
java gshute.trees.SearchTreeTester nodeClass [ file ]
If this program is executed with no file name argument then it executes commands entered from the terminal.
 
Methods inherited from class gshute.ioutil.Tester
doCommands, openStream, startInteractive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theTree

protected SearchTree theTree
theTree is the SearchTree that is being tested by this SearchTreeTester.
Constructor Detail

SearchTreeTester

public SearchTreeTester()
Method Detail

addCommands

public void addCommands()
addCommands() adds testing commands to the command table.
Overrides:
addCommands in class Tester

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Program synopsis:
java gshute.trees.SearchTreeTester nodeClass [ file ]

If this program is executed with no file name argument then it executes commands entered from the terminal. If it is executed with a single file name argument then the program attempts to open the named file and execute the commands in it. If the open fails, or if there is more than one file name argument, then the program terminates with an error message.

The nodeClass argument must be the name of a subclass of the TreeNode class. The subclass should have a constructor with a single Object parameter. This constructor is used to build trees for this program. The constructor should call the superclass constructor to ensure that the parameter is installed as the data for the node that is created by the constructor.