public class ElementIterator extends Object implements 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 |
---|---|
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 int depth()
public Element next()