forester v1.3

forester.tree
Class PostorderTreeIterator

java.lang.Object
  |
  +--forester.tree.PostorderTreeIterator
All Implemented Interfaces:
forester.tree.Iterator

public class PostorderTreeIterator
extends java.lang.Object
implements forester.tree.Iterator

Version:
1.01 last modified: 06/14/00
Author:
Christian M. Zmasek

Constructor Summary
PostorderTreeIterator(Tree t)
          Constructor which creates a postorder Iterator for Tree t.
 
Method Summary
 Node currentNode()
          Returns the current Node, unless all Nodes have been visited (isDone() returns true), in which case it returns null.
 void first()
          Resets the Iterator.
 boolean isDone()
          Returns true if all Nodes have been visited.
 void next()
          Advances the Iterator by one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostorderTreeIterator

public PostorderTreeIterator(Tree t)
                      throws java.lang.Exception
Constructor which creates a postorder Iterator for Tree t. This implements the Iterator pattern as described in Gamma et al. "Design Patterns Elements of Reusable Object-Oriented Software".
Parameters:
t - Tree for which a Iterator is to be constructed.
Method Detail

first

public void first()
Resets the Iterator.
Specified by:
first in interface forester.tree.Iterator

next

public void next()
Advances the Iterator by one.
Specified by:
next in interface forester.tree.Iterator

isDone

public boolean isDone()
Returns true if all Nodes have been visited.
Specified by:
isDone in interface forester.tree.Iterator

currentNode

public Node currentNode()
Returns the current Node, unless all Nodes have been visited (isDone() returns true), in which case it returns null.
Specified by:
currentNode in interface forester.tree.Iterator

forester v1.3