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> extends Object implements Iterator<I>, Iterable<I>
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 and Description |
---|
AbstractHierarchyIterator(N root)
Deprecated.
Construct.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public AbstractHierarchyIterator(N root)
root
- 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()
protected boolean onFilter(N node)
node
- protected boolean onTraversalFilter(N node)
hasChildren(Object)
return true.node
- public I next()
public void skipRemainingSiblings()
Can as well be called within IteratorFilter.onFilter(Object)
.
public void dontGoDeeper()
Can as well be called within IteratorFilter.onFilter(Object)
.
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.