|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jopendocument.util.DescendantIterator
public class DescendantIterator
Traverse a parent's descendants (children at any level below the parent).
Element.getDescendants(Filter)
allows to filter after having descended, this class allows
to filter before. I.e. if the element is :
and the filter rejects elements named "a" ;foo
Element.getDescendants(Filter)
will return
the Text
"foo", while this class will return nothing.
Constructor Summary | |
---|---|
DescendantIterator(org.jdom.Parent parent)
Iterator for the descendants of the supplied object. |
|
DescendantIterator(org.jdom.Parent parent,
org.jdom.filter.Filter filter)
|
|
DescendantIterator(org.jdom.Parent parent,
IPredicate<? super org.jdom.Content> pred)
|
Method Summary | |
---|---|
boolean |
hasNext()
Returns true> if the iteration has more Content descendants. |
org.jdom.Content |
next()
Returns the next Content descendant. |
void |
remove()
Detaches the last Content returned by the last call to next from it's
parent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DescendantIterator(org.jdom.Parent parent)
parent
- document or element whose descendants will be iteratedpublic DescendantIterator(org.jdom.Parent parent, IPredicate<? super org.jdom.Content> pred)
public DescendantIterator(org.jdom.Parent parent, org.jdom.filter.Filter filter)
Method Detail |
---|
public boolean hasNext()
Content
descendants.
hasNext
in interface Iterator<org.jdom.Content>
public org.jdom.Content next()
Content
descendant.
next
in interface Iterator<org.jdom.Content>
public void remove()
Content
returned by the last call to next from it's
parent. Note: this does not affect iteration and all children, siblings, and
any node following the removed node (in document order) will be visited.
remove
in interface Iterator<org.jdom.Content>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |