cetus.hir
Class FlatIterator

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

public class FlatIterator
extends IRIterator

Iterates over the immediate children of a Traversable object.


Field Summary
 
Fields inherited from class cetus.hir.IRIterator
root
 
Constructor Summary
FlatIterator(Traversable parent)
          Creates a new iterator.
 
Method Summary
 void add(Traversable t)
          Adds an object after the last object that was returned by next or previous.
 java.util.List 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.
 boolean hasPrevious()
           
 java.lang.Object next()
          Returns the next element in the iteration.
 java.lang.Object previous()
           
 void remove()
          Removes the last object that was returned by next or previous.
 void reset()
          Moves the iterator back to the beginning of the sequence.
 
Methods inherited from class cetus.hir.IRIterator
containsCompatibleClass, next, next, nextExcept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlatIterator

public FlatIterator(Traversable parent)
Creates a new iterator.

Parameters:
parent - The parent of the children to visit.
Method Detail

add

public void add(Traversable t)
Adds an object after the last object that was returned by next or previous.

Parameters:
t - The object to add.

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.

hasPrevious

public boolean hasPrevious()

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.

previous

public java.lang.Object previous()

remove

public void remove()
Removes the last object that was returned by next or previous.

Specified by:
remove in interface java.util.Iterator
Overrides:
remove in class IRIterator

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

getList

public java.util.List 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