Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

iiuf.util
Class Tree  view Tree download Tree.java

java.lang.Object
  extended byiiuf.util.Tree
Direct Known Subclasses:
BinaryTree

public abstract class Tree
extends java.lang.Object

Implementation of tree base class. (c) 1999, 2000, 2001, IIUF, DIUF

Version:
$Name: $ $Revision: 1.1 $

Field Summary
protected  TreeNode NIL
           
protected  TreeNode root
           
private  java.lang.Object[] t_array
           
 
Constructor Summary
Tree(TreeNode NIL_)
           
 
Method Summary
abstract  void add(TreeNode node)
          Adds a node to the tree.
 void changed()
           
protected  void error()
           
 TreeNode nil()
           
 void postorderWalk(TreeNode x, TreeWalk handler, java.lang.Object misc)
          Walks the tree postorder.
 void preorderWalk(TreeNode x, TreeWalk handler, java.lang.Object misc)
          Walks the tree preorder.
abstract  void remove(TreeNode node)
          Removes a node from the tree.
 java.lang.Object[] toArray()
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
protected  java.lang.String verify()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

root

protected TreeNode root

NIL

protected TreeNode NIL

t_array

private java.lang.Object[] t_array
Constructor Detail

Tree

public Tree(TreeNode NIL_)
Method Detail

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


nil

public TreeNode nil()

add

public abstract void add(TreeNode node)
Adds a node to the tree.


remove

public abstract void remove(TreeNode node)
Removes a node from the tree.


preorderWalk

public void preorderWalk(TreeNode x,
                         TreeWalk handler,
                         java.lang.Object misc)
Walks the tree preorder.


postorderWalk

public void postorderWalk(TreeNode x,
                          TreeWalk handler,
                          java.lang.Object misc)
Walks the tree postorder.


changed

public void changed()

toArray

public java.lang.Object[] toArray()

error

protected void error()

verify

protected java.lang.String verify()