net.sf.saxon.expr

Class ReverseRangeIterator

public class ReverseRangeIterator extends Object implements SequenceIterator, ReversibleIterator, LastPositionFinder, LookaheadIterator

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
ReverseRangeIterator(long start, long end)
Create an iterator over a range of integers in monotonic descending order
Method Summary
voidclose()
Itemcurrent()
SequenceIteratorgetAnother()
intgetLastPosition()
intgetProperties()
Get properties of this iterator, as a bit-significant integer.
SequenceIteratorgetReverseIterator()
booleanhasNext()
Itemnext()
intposition()

Field Detail

currentValue

long currentValue

limit

long limit

start

long start

Constructor Detail

ReverseRangeIterator

public ReverseRangeIterator(long start, long end)
Create an iterator over a range of integers in monotonic descending order

Parameters: start the first integer to be delivered (the highest in the range) end the last integer to be delivered (the lowest in the range). 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()

next

public Item next()

position

public int position()