net.sf.saxon.expr

Class ValueTailIterator

Implemented Interfaces:
GroundedIterator, LookaheadIterator, SequenceIterator

public class ValueTailIterator
extends java.lang.Object
implements SequenceIterator, GroundedIterator, LookaheadIterator

ValueTailIterator iterates over a base sequence starting at an element other than the first. It is used in the case where the base sequence is "grounded", that is, it exists in memory and supports efficient direct addressing.

Fields inherited from interface net.sf.saxon.om.SequenceIterator

GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD

Constructor Summary

ValueTailIterator(GroundedValue base, int start)
Construct a ValueTailIterator

Method Summary

Item
current()
SequenceIterator
getAnother()
int
getProperties()
Get properties of this iterator, as a bit-significant integer.
boolean
hasNext()
Determine whether there are more items to come.
GroundedValue
materialize()
Return a Value containing all the items in the sequence returned by this SequenceIterator.
Item
next()
int
position()

Constructor Details

ValueTailIterator

public ValueTailIterator(GroundedValue base,
                         int start)
            throws XPathException
Construct a ValueTailIterator
Parameters:
base - The items to be filtered
start - The position of the first item to be included (zero-based)
Throws:
XPathException -

Method Details

current

public Item current()
Specified by:
current in interface SequenceIterator

getAnother

public SequenceIterator getAnother()
            throws XPathException
Specified by:
getAnother in interface SequenceIterator

getProperties

public int getProperties()
Get properties of this iterator, as a bit-significant integer.
Specified by:
getProperties in interface SequenceIterator
Returns:
the properties of this iterator. This will be some combination of properties such as SequenceIterator.GROUNDED, SequenceIterator.LAST_POSITION_FINDER, and SequenceIterator.LOOKAHEAD. It is always acceptable to return the value zero, indicating that there are no known special properties. It is acceptable for the properties of the iterator to change depending on its state.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface LookaheadIterator
Returns:
true if there are more items in the sequence

materialize

public GroundedValue materialize()
            throws XPathException
Return a Value containing all the items in the sequence returned by this SequenceIterator. This should be an "in-memory" value, not a Closure.
Specified by:
materialize in interface GroundedIterator
Returns:
the corresponding Value

next

public Item next()
            throws XPathException
Specified by:
next in interface SequenceIterator

position

public int position()
Specified by:
position in interface SequenceIterator