net.sf.saxon.expr
Class TailIterator
java.lang.Object
net.sf.saxon.expr.TailIterator
- LastPositionFinder, LookaheadIterator, SequenceIterator
public class TailIterator
extends java.lang.Object
TailIterator iterates over a base sequence starting at an element other than the first.
The base sequence is represented by an iterator which is consumed in the process
getLastPosition
public int getLastPosition()
throws XPathException
Get the last position (that is, the number of items in the sequence). This method is
non-destructive: it does not change the state of the iterator.
The result is undefined if the next() method of the iterator has already returned null.
This method must not be called unless the result of getProperties() on the iterator
includes the bit setting
SequenceIterator.LAST_POSITION_FINDER
- getLastPosition in interface LastPositionFinder
getProperties
public int getProperties()
Get properties of this iterator, as a bit-significant integer.
- getProperties in interface SequenceIterator
hasNext
public boolean hasNext()
Determine whether there are more items to come. Note that this operation
is stateless and it is not necessary (or usual) to call it before calling
next(). It is used only when there is an explicit need to tell if we
are at the last element.
This method must not be called unless the result of getProperties() on the iterator
includes the bit setting
SequenceIterator.LOOKAHEAD
- hasNext in interface LookaheadIterator
- true if there are more items in the sequence
make
public static SequenceIterator make(SequenceIterator base,
int start)
throws XPathException
Static factory method. Creates a TailIterator, unless the base Iterator is an
ArrayIterator, in which case it optimizes by creating a new ArrayIterator directly over the
underlying array. This optimization is important when doing recursion over a node-set using
repeated calls of $nodes[position()>1]
base
- An iteration of the items to be filteredstart
- The position of the first item to be included (base 1)
- an iterator over the items in the sequence from the start item to the end of the sequence.
The returned iterator will not necessarily be an instance of this class.