echopoint.tree
Class PathBetweenNodesEnumeration
java.lang.Object
echopoint.tree.PathBetweenNodesEnumeration
- All Implemented Interfaces:
- Serializable, Enumeration<TreeNode>
public final class PathBetweenNodesEnumeration
- extends Object
- implements Enumeration<TreeNode>, Serializable
An enumeration that follows the path from ancestor to the node.
The enumeration's nextElement() method first returns
ancestor, then the child of ancestor that is an ancestor
of the node, and so on, and finally returns this node. Creation of the
enumeration is O(m) where m is the number of nodes between this node and
ancestor, inclusive. Each nextElement() message is O(1).
- Since:
- 3.0.0b3
- Version:
- $Id: PathBetweenNodesEnumeration.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<TreeNode> stack
PathBetweenNodesEnumeration
public PathBetweenNodesEnumeration(TreeNode ancestor,
TreeNode descendant)
- Create a new enumeration from the specified ancestor the destination.
- Parameters:
ancestor - The start of the enumeration.descendant - The destination of the enumeration.
hasMoreElements
public boolean hasMoreElements()
-
- Specified by:
hasMoreElements in interface Enumeration<TreeNode>
nextElement
public TreeNode nextElement()
-
- Specified by:
nextElement in interface Enumeration<TreeNode>