net.sf.saxon.expr

Class RangeIterator

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

An 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
longlimit
longstart
Constructor Summary
RangeIterator(long start, long end)
Create an iterator over a range of monotonically increasing integers
Method Summary
voidclose()
Itemcurrent()
SequenceIteratorgetAnother()
intgetLastPosition()
intgetProperties()
Get properties of this iterator, as a bit-significant integer.
SequenceIteratorgetReverseIterator()
booleanhasNext()
GroundedValuematerialize()
Return a Value containing all the items in the sequence returned by this SequenceIterator.
Itemnext()
intposition()

Field Detail

currentValue

long currentValue

limit

long limit

start

long start

Constructor Detail

RangeIterator

public RangeIterator(long start, long end)
Create an iterator over a range of monotonically increasing integers

Parameters: start the first integer in the sequence end the last integer in the sequence. Must be >= start.

Method Detail

close

public void close()

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 GROUNDED, LAST_POSITION_FINDER, and 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 GroundedValue 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()