edu.uci.eecs.doc.cascade.tree
Class TreeIterator

java.lang.Object
  extended by edu.uci.eecs.doc.cascade.tree.TreeIterator
All Implemented Interfaces:
Iterator<Node>

public class TreeIterator
extends Object
implements Iterator<Node>

Iterates over the nodes of a control flow tree.

Author:
Trevor Harmon
See Also:
Tree

Constructor Summary
TreeIterator(Node startNode)
          Creates a new TreeIterator object starting at the given node.
 
Method Summary
 boolean hasNext()
          Returns true if this iterator has more nodes.
 Node next()
          Returns the next node in the iteration.
 void remove()
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeIterator

public TreeIterator(Node startNode)
Creates a new TreeIterator object starting at the given node.

Parameters:
startNode - a node in a control flow tree
Method Detail

hasNext

public boolean hasNext()
Returns true if this iterator has more nodes. (In other words, returns true if calling next would return a node rather than throwing an exception.)

Specified by:
hasNext in interface Iterator<Node>
Returns:
true if the iterator has more elements

next

public Node next()
Returns the next node in the iteration.

Specified by:
next in interface Iterator<Node>
Returns:
a node in the control flow tree

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<Node>