echopoint.tree
Class PreorderEnumeration
java.lang.Object
echopoint.tree.PreorderEnumeration
- All Implemented Interfaces:
- Serializable, Enumeration<TreeNode>
public final class PreorderEnumeration
- extends Object
- implements Enumeration<TreeNode>, Serializable
An enumeration used to traverse the subtree rooted at
a node in preorder. The first node returned by the enumeration's
nextElement() method is the node from which the enumeration
was created.
- Since:
- 3.0.0b3
- Version:
- $Id: PreorderEnumeration.java 213 2009-06-03 16:34:13Z sptrakesh $
- Author:
- Brad Baker, Rakesh Vidyadharan 2009-05-29
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
stack
protected Stack<Enumeration<TreeNode>> stack
PreorderEnumeration
public PreorderEnumeration(TreeNode rootNode)
- Create a new enumeration for the specified node.
- Parameters:
rootNode - The node for which a pre-order enumeration is to be
returned.
hasMoreElements
public boolean hasMoreElements()
-
- Specified by:
hasMoreElements in interface Enumeration<TreeNode>
nextElement
public TreeNode nextElement()
-
- Specified by:
nextElement in interface Enumeration<TreeNode>