public class BreadthFirstIterator<E extends Traversable> extends IRIterator<E>
| Constructor and Description |
|---|
BreadthFirstIterator(Traversable init)
Creates a new iterator with the specified initial object and the
optional list of pruned types.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Unlike the reset method, clear method also clears the
pruned types.
|
java.util.LinkedList |
getList(java.lang.Class<? extends Traversable> c)
Returns a linked list of objects of Class c in the IR
|
java.util.Set |
getSet(java.lang.Class<? extends Traversable> c)
Returns a set of objects of Class c in the IR
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
E |
next()
Returns the next element in the iteration.
|
void |
pruneOn(java.lang.Class<? extends Traversable> c)
Disables traversal from an object having the specified type.
|
void |
reset()
Resets the iterator by setting the current position to the root object.
|
next, next, nextExcept, removepublic BreadthFirstIterator(Traversable init)
init - The first object to visit.public boolean hasNext()
IRIteratorhasNext in interface java.util.Iterator<E extends Traversable>hasNext in class IRIterator<E extends Traversable>public E next()
IRIteratornext in interface java.util.Iterator<E extends Traversable>next in class IRIterator<E extends Traversable>public void pruneOn(java.lang.Class<? extends Traversable> c)
c - the object type to be pruned on.public java.util.LinkedList getList(java.lang.Class<? extends Traversable> c)
c - the object type to be collected.public java.util.Set getSet(java.lang.Class<? extends Traversable> c)
c - the object type to be collected.public void reset()
reset in class IRIterator<E extends Traversable>public void clear()