|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A SequenceIterator is used to iterate over any XPath 2 sequence (of values or nodes). It is modelled on the JDK 1.2 Iterator class, but differs in two main respects: a SequenceIterator can be cloned (to create a new iterator that iterates over the same sequence of values, but with the initial position reset to the start); and the methods can throw exceptions if access to the underlying data fails. Also, a SequenceIterator keeps track of the current Item and the current position. The objects returned by the SequenceIterator will always be either nodes (class NodeInfo) or singleton values (class AtomicValue), these are represented by the interface Item.
Method Summary | |
Item |
current()
Get the current value in the sequence (the one returned by the most recent call on next()). |
SequenceIterator |
getAnother()
Get another SequenceIterator that iterates over the same items as the original, but which is repositioned at the start of the sequence. |
boolean |
hasNext()
Determine whether there are more items to come. |
Item |
next()
Get the next item in the sequence. |
int |
position()
Get the current position. |
Method Detail |
public boolean hasNext() throws XPathException
XPathException
- if any error occurs while determining whether
there are more items in the sequencepublic Item next() throws XPathException
XPathException
- if an error occurs retrieving the next itempublic Item current()
public int position()
public SequenceIterator getAnother() throws XPathException
XPathException
- if any error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |