|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.molae.pipe.tree.DepthFirstIterator<E>
public final class DepthFirstIterator<E>
Provides an Iterator that runs depth first through a tree. For each tree node a method that returns its children as a collection is required. This can be done by
getComponents()
in the
interface Composition
.CompositionView
that
contains the method calls for each class, that return the children.
Constructor Summary | |
---|---|
DepthFirstIterator(E pObject,
CompositionView<E> pCompositionView)
Constructs a DepthFirstIterator . |
|
DepthFirstIterator(Iterator<E> iterator,
CompositionView<E> pCompositionView)
Constructs a DepthFirstIterator . |
Method Summary | |
---|---|
boolean |
hasNext()
|
static DepthFirstIterator<Object> |
newInstance(Object pObject)
Constructs a DepthFirstIterator . |
E |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DepthFirstIterator(Iterator<E> iterator, CompositionView<E> pCompositionView)
DepthFirstIterator
.
iterator
- an iterator defining the topmost level of the treepCompositionView
- underlying composition view,
must not be null
.public DepthFirstIterator(E pObject, CompositionView<E> pCompositionView)
DepthFirstIterator
.
pObject
- The root of the tree to be traversedpCompositionView
- underlying composition view,
must not be null
.Method Detail |
---|
public static DepthFirstIterator<Object> newInstance(Object pObject)
DepthFirstIterator
.
pObject
- The root of the tree to be traversedpublic boolean hasNext()
hasNext
in interface Iterator<E>
public E next()
next
in interface Iterator<E>
NoSuchElementException
- iteration has no more elements.public void remove()
remove
in interface Iterator<E>
UnsupportedOperationException
- depending on the collections of
the base tree
IllegalStateException
- if the next method has not
yet been called, or the remove method has already
been called after the last call to the next method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |