Opus5
Class AbstractTree.TreeEnumeration

java.lang.Object
  |
  +--Opus5.AbstractTree.TreeEnumeration
All Implemented Interfaces:
java.util.Enumeration, Enumeration
Enclosing class:
AbstractTree

protected class AbstractTree.TreeEnumeration
extends java.lang.Object
implements Enumeration

Implements an enumeration that enumerates the keys in this tree.

Version:
$Id: AbstractTree.java,v 3.4 1998/09/21 20:28:22 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.
See Also:
Enumeration

Field Summary
protected  Stack stack
          Used to keep track of the nodes to be enumerated.
 
Fields inherited from interface Opus5.Enumeration
copyright
 
Constructor Summary
AbstractTree.TreeEnumeration()
          Constructs an TreeEnumeration that enumerates the keys in this tree.
 
Method Summary
 boolean hasMoreElements()
          Tests whether there are still more keys to be enumerated.
 java.lang.Object nextElement()
          Returns the next key to be enumerated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

protected Stack stack
Used to keep track of the nodes to be enumerated.
Constructor Detail

AbstractTree.TreeEnumeration

public AbstractTree.TreeEnumeration()
Constructs an TreeEnumeration that enumerates the keys in this tree. Pushes the root node of the tree onto the stack.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests whether there are still more keys to be enumerated. As long as there are nodes in the stack, there are still more keys to be enumerated.
Specified by:
hasMoreElements in interface Enumeration
Returns:
True if there are still more keys to be enumerated.

nextElement

public java.lang.Object nextElement()
Returns the next key to be enumerated. The next key to be enumerated is in the tree node found at the top of stack. Pops the stack and pushes the children of the node which was at the top of the stack.
Specified by:
nextElement in interface Enumeration
Returns:
The next key to be enumerated.