|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.iterator.AbstractHierarchyIterator<N,I>
I
- The type relevant for the iterator. What you expect to get back from next(), e.g.
Form.N
- The base type of all nodes, e.g. ComponentIVisitor
instead.
@Deprecated public abstract class AbstractHierarchyIterator<N,I extends N>
This is a basic iterator for hierarchical structures such as Component hierarchies or HTML markup. It supports child first and parent first traversal and intercepts while moving down or up the hierarchy.
It assumes the container class implements Iterable
. The leaf nodes don't need to.
Consecutive calls to hasNext()
without next()
in between, don't move
the cursor, but return the same value until next()
is called.
Every call to next()
, with or without hasNext()
, will move the cursor
to the next element.
MarkupContainer.visitChildren(org.apache.wicket.util.visit.IVisitor)
,
MarkupContainer.visitChildren(Class, org.apache.wicket.util.visit.IVisitor)
Constructor Summary | |
---|---|
AbstractHierarchyIterator(N root)
Deprecated. Construct. |
Method Summary | |
---|---|
void |
dontGoDeeper()
Deprecated. Assuming we are currently at a container, than ignore all its children and grand-children and continue with the next sibling. |
protected abstract boolean |
hasChildren(N node)
Deprecated. |
boolean |
hasNext()
Deprecated. |
Iterator<I> |
iterator()
Deprecated. |
protected abstract Iterator<N> |
newIterator(N node)
Deprecated. If node is a container than return an iterator for its children. |
I |
next()
Deprecated. Traverse the hierarchy and get the next element |
protected boolean |
onFilter(N node)
Deprecated. Gets called for each element within the hierarchy (nodes and leafs) |
protected boolean |
onTraversalFilter(N node)
Deprecated. Gets called for each element where hasChildren(Object) return true. |
void |
remove()
Deprecated. |
void |
setChildFirst(boolean childFirst)
Deprecated. |
void |
skipRemainingSiblings()
Deprecated. Skip all remaining siblings and return to the parent node. |
String |
toString()
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractHierarchyIterator(N root)
root
- Method Detail |
---|
public final void setChildFirst(boolean childFirst)
childFirst
- If true, than children are visited before their parent is.protected abstract boolean hasChildren(N node)
node
-
protected abstract Iterator<N> newIterator(N node)
Gets only called if hasChildren(Object)
return true.
node
-
public boolean hasNext()
hasNext
in interface Iterator<I extends N>
protected boolean onFilter(N node)
node
-
protected boolean onTraversalFilter(N node)
hasChildren(Object)
return true.
node
-
public I next()
next
in interface Iterator<I extends N>
public void remove()
remove
in interface Iterator<I extends N>
public void skipRemainingSiblings()
Can as well be called within IteratorFilter.onFilter(Object)
.
public void dontGoDeeper()
Can as well be called within IteratorFilter.onFilter(Object)
.
public final Iterator<I> iterator()
iterator
in interface Iterable<I extends N>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |