|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sri.emo.dbobj.model_tree.ModelDepthFirstIterator
public class ModelDepthFirstIterator
Implementation of Iterator that allows depth first iteratation over all the nodes in a model. This iterator does not allow for removal of individual nodes: it is read only.
Constructor Summary | |
---|---|
ModelDepthFirstIterator(ModelNode root)
Constructor that takes the root of what it is suppsoed to iterate. |
|
ModelDepthFirstIterator(ModelNode root,
TreeTraversalListener listener)
Constructor that takes a listener as well as a root of what it is supposed to iterate. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if the iteration has more elements. |
Object |
next()
Returns the next element in the iteration. |
void |
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelDepthFirstIterator(ModelNode root)
root
- ModelCompositeNodepublic ModelDepthFirstIterator(ModelNode root, TreeTraversalListener listener)
root
- ModelNode the root composite node that we're iterating
in a depth first fashion.listener
- TreeTraversalListener the notification sink that receives
notifications of traversal down or up the tree. This iterator is
guaranteed to only traverse down one level at a time, although it may
traverse up several levels.Method Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator
public Object next()
next
in interface Iterator
public void remove()
remove
in interface Iterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |