org.w3c.dom.fi
Interface NodeIterator
- public abstract interface NodeIterator
NodeIterators are used to step through a set of nodes, e.g. the set of nodes
in a NodeList, the document subtree governed by a particular node, the results
of a query, or any other set of nodes. The set of nodes to be iterated is
determined by the factory that creates the iterator.
Any iterator that returns nodes may implement the NodeIterator interface.
Users and vendor libraries may also choose to create iterators that implement
the NodeIterator interface.
Method Summary |
Node |
nextNode()
Returns the next node in the set and advances the position of the iterator
in the set. |
Node |
prevNode()
Returns the previous node in the set and moves the position of the
iterator backwards in the set |
nextNode
public Node nextNode()
- Returns the next node in the set and advances the position of the iterator
in the set. After a NodeIterator is created, the first call to nextNode()
returns the first node in the set.
- Returns:
- The next Node in the set being iterated over, or NULL if there are
no more members in that set
prevNode
public Node prevNode()
- Returns the previous node in the set and moves the position of the
iterator backwards in the set
- Returns:
- The previous Node in the set being iterated over, or NULL if there
are no more members in that set.