echopoint.tree
Class BreadthFirstEnumeration
java.lang.Object
echopoint.tree.BreadthFirstEnumeration
- All Implemented Interfaces:
- Enumeration<TreeNode>
public final class BreadthFirstEnumeration
- extends Object
- implements Enumeration<TreeNode>
An enumeration that traverses the subtree rooted at
a node in breadth-first order. The first node returned by the
enumeration's nextElement() method is the node for which the
enumeration was created.
- Version:
- $Id: BreadthFirstEnumeration.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 |
queue
protected Queue<Enumeration<TreeNode>> queue
BreadthFirstEnumeration
public BreadthFirstEnumeration(TreeNode rootNode)
- Create a new enumeration for the specified tree node.
- Parameters:
rootNode - The node for which the enumeration is created.
hasMoreElements
public boolean hasMoreElements()
-
- Specified by:
hasMoreElements in interface Enumeration<TreeNode>
nextElement
public TreeNode nextElement()
-
- Specified by:
nextElement in interface Enumeration<TreeNode>