net.sf.saxon.expr

Class RangeIterator

public class RangeIterator extends Object implements SequenceIterator, ReversibleIterator, LastPositionFinder, LookaheadIterator, GroundedIterator

Iterator that produces numeric values in a monotonic sequence, ascending or descending. Although a range expression (N to M) is always in ascending order, applying the reverse() function will produce a RangeIterator that works in descending order.
Field Summary
longcurrentValue
intincrement
longlimit
longstart
Constructor Summary
RangeIterator(long start, long end)
Method Summary
Itemcurrent()
SequenceIteratorgetAnother()
intgetLastPosition()
intgetProperties()
Get properties of this iterator, as a bit-significant integer.
SequenceIteratorgetReverseIterator()
booleanhasNext()
Valuematerialize()
Return a Value containing all the items in the sequence returned by this SequenceIterator.
Itemnext()
intposition()

Field Detail

currentValue

long currentValue

increment

int increment

limit

long limit

start

long start

Constructor Detail

RangeIterator

public RangeIterator(long start, long end)

Method Detail

current

public Item current()

getAnother

public SequenceIterator getAnother()

getLastPosition

public int getLastPosition()

getProperties

public int getProperties()
Get properties of this iterator, as a bit-significant integer.

Returns: the properties of this iterator. This will be some combination of properties such as net.sf.saxon.om.SequenceIterator.GROUNDED, net.sf.saxon.om.SequenceIterator.LAST_POSITION_FINDER, and net.sf.saxon.om.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.

getReverseIterator

public SequenceIterator getReverseIterator()

hasNext

public boolean hasNext()

materialize

public Value materialize()
Return a Value containing all the items in the sequence returned by this SequenceIterator. This should be an "in-memory" value, not a Closure.

Returns: the corresponding Value

next

public Item next()

position

public int position()