cetus.hir
Class BreadthFirstIterator

java.lang.Object
  extended by cetus.hir.IRIterator
      extended by cetus.hir.BreadthFirstIterator
All Implemented Interfaces:
java.util.Iterator

public class BreadthFirstIterator
extends IRIterator

Iterates over Traversable objects in breadth-first order.


Field Summary
 
Fields inherited from class cetus.hir.IRIterator
root
 
Constructor Summary
BreadthFirstIterator(Traversable init)
          Creates a new iterator.
 
Method Summary
 java.util.LinkedList getList(java.lang.Class c)
          Returns a linked list of objects of Class c in the IR
 java.util.Set getSet(java.lang.Class c)
          Returns a set of objects of Class c in the IR
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void pruneOn(java.lang.Class c)
           
 void reset()
          Moves the iterator back to the beginning of the sequence.
 
Methods inherited from class cetus.hir.IRIterator
containsCompatibleClass, next, next, nextExcept, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreadthFirstIterator

public BreadthFirstIterator(Traversable init)
Creates a new iterator.

Parameters:
init - The first object to visit.
Method Detail

hasNext

public boolean hasNext()
Description copied from class: IRIterator
Returns true if the iteration has more elements. (In other words, returns true if a call to next would return an element rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in class IRIterator
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
Description copied from class: IRIterator
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Specified by:
next in class IRIterator
Returns:
the next element in the iteration.

pruneOn

public void pruneOn(java.lang.Class c)

getList

public java.util.LinkedList getList(java.lang.Class c)
Returns a linked list of objects of Class c in the IR


getSet

public java.util.Set getSet(java.lang.Class c)
Returns a set of objects of Class c in the IR


reset

public void reset()
Description copied from class: IRIterator
Moves the iterator back to the beginning of the sequence.

Specified by:
reset in class IRIterator