public class ElementIterator extends java.lang.Object implements java.lang.Cloneable
| Constructor and Description |
|---|
ElementIterator(Document document)
Create a new ElementIterator to iterate over the given document.
|
ElementIterator(Element root)
Create a new ElementIterator to iterate over the given document.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a new ElementIterator which is a clone of this
ElementIterator.
|
Element |
current()
Returns the current element.
|
int |
depth()
Returns the depth to which we have descended in the tree.
|
Element |
first()
Returns the first element in the tree.
|
Element |
next()
Advance the iterator and return the next element of the tree,
performing an "in-order" traversal.
|
Element |
previous()
Returns the previous item.
|
public ElementIterator(Document document)
document - the Document over which we iteratepublic ElementIterator(Element root)
root - the Document over which we iteratepublic java.lang.Object clone()
clone in class java.lang.ObjectCloneablepublic int depth()
public Element next()