public interface FocusIterator extends SequenceIterator
ATOMIZING, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
Modifier and Type | Method and Description |
---|---|
Item |
current()
Get the current value in the sequence (the one returned by the
most recent call on next()).
|
FocusIterator |
getAnother()
Get another SequenceIterator that iterates over the same items as the original,
but which is repositioned at the start of the sequence.
|
int |
getLength()
Get the position of the last item in the sequence
|
int |
position()
Get the current position.
|
close, getProperties, next
Item current()
int position()
int getLength() throws XPathException
XPathException
- if a failure occurs reading the sequenceFocusIterator getAnother() throws XPathException
This method allows access to all the items in the sequence without disturbing the current position of the iterator. Internally, its main use is in evaluating the last() function.
This method does not change the state of the iterator.
Some implementations of this method may regenerate the input sequence, creating new nodes with different identity from the original. This is not recommended, but is hard to prevent. This causes no problem for the primary usage of this method to support the last() function, but it has been known to cause trouble in other situations.
getAnother
in interface SequenceIterator
XPathException
- if any error occursCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.