echopoint.tree
Class PostorderEnumeration
java.lang.Object
echopoint.tree.PostorderEnumeration
- All Implemented Interfaces:
- Enumeration<TreeNode>
public final class PostorderEnumeration
- extends Object
- implements Enumeration<TreeNode>
An enumeration that traverses the subtree rooted at a node in postorder.
The first node returned by the enumeration's nextElement() method is
the leftmost leaf. This is the same as a depth-first traversal.
- Since:
- 3.0.0b3
- Version:
- $Id: PostorderEnumeration.java 213 2009-06-03 16:34:13Z sptrakesh $
- Author:
- Brad Baker, Rakesh Vidyadharan 2009-05-29
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
root
protected TreeNode root
children
protected Enumeration<TreeNode> children
subtree
protected Enumeration<TreeNode> subtree
PostorderEnumeration
public PostorderEnumeration(TreeNode rootNode)
- Create a new enumeration for the specified node.
- Parameters:
rootNode - The node for which the enumeration is to be created.
hasMoreElements
public boolean hasMoreElements()
-
- Specified by:
hasMoreElements in interface Enumeration<TreeNode>
nextElement
public TreeNode nextElement()
-
- Specified by:
nextElement in interface Enumeration<TreeNode>