public class DescendingRangeIterator extends net.sf.saxon.expr.RangeIterator implements AtomicIterator, ReversibleIterator, LastPositionFinder, LookaheadIterator
Constructor and Description |
---|
DescendingRangeIterator(long start,
long step,
long end)
Create an iterator over a range of integers in monotonic descending order
|
Modifier and Type | Method and Description |
---|---|
IntegerValue |
getFirst() |
IntegerValue |
getLast() |
int |
getLength()
Get the last position (that is, the number of items in the sequence).
|
IntegerValue |
getMax() |
IntegerValue |
getMin() |
GroundedValue |
getResidue()
Return a GroundedValue containing all the remaining items in the sequence returned by this
SequenceIterator, starting at the current position.
|
AtomicIterator |
getReverseIterator()
Get a new SequenceIterator that returns the same items in reverse order.
|
IntegerValue |
getStep()
Get the increment between successive values.
|
boolean |
hasNext()
Determine whether there are more items to come.
|
boolean |
isActuallyGrounded()
Ask if the iterator is actually grounded.
|
GroundedValue |
materialize()
Return a GroundedValue containing all the items in the sequence returned by this
SequenceIterator.
|
IntegerValue |
next()
Get the next atomic value in the sequence.
|
boolean |
supportsGetLength()
Ask whether this iterator supports use of the
LastPositionFinder.getLength() method. |
boolean |
supportsHasNext()
Ask whether the hasNext() method can be called.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, discharge
public DescendingRangeIterator(long start, long step, long end)
start
- the first integer to be delivered (the highest in the range)step
- the difference between successive values, supplied as a positive integerend
- the last integer to be delivered (the lowest in the range). Must be <= startpublic boolean isActuallyGrounded()
GroundedIterator
GroundedIterator.materialize()
or GroundedIterator.getResidue()
, because the iterator might
be grounded under some conditions and not others (usually when it delegates
to another iterator)isActuallyGrounded
in interface GroundedIterator
public GroundedValue materialize()
materialize
in interface GroundedIterator
materialize
in class net.sf.saxon.expr.RangeIterator
UncheckedXPathException
- in the cases of subclasses (such as the iterator over a MemoClosure)
which cause evaluation of expressions while materializing the value.public GroundedValue getResidue()
getResidue
in interface GroundedIterator
getResidue
in class net.sf.saxon.expr.RangeIterator
UncheckedXPathException
- in the cases of subclasses (such as the iterator over a MemoClosure)
which cause evaluation of expressions while materializing the value.public IntegerValue getFirst()
public IntegerValue getLast()
public IntegerValue getMin()
public IntegerValue getMax()
public IntegerValue getStep()
public boolean supportsHasNext()
LookaheadIterator
supportsHasNext
in interface LookaheadIterator
LookaheadIterator.hasNext()
method is availablepublic boolean hasNext()
LookaheadIterator
This method must not be called unless the result of LookaheadIterator.supportsHasNext()
is true.
hasNext
in interface LookaheadIterator
hasNext
in class net.sf.saxon.expr.RangeIterator
public IntegerValue next()
AtomicIterator
next
in interface SequenceIterator
next
in interface AtomicIterator
next
in class net.sf.saxon.expr.RangeIterator
public boolean supportsGetLength()
LastPositionFinder
LastPositionFinder.getLength()
method. This
method should always be called before calling LastPositionFinder.getLength()
, because an iterator
that implements this interface may support use of LastPositionFinder.getLength()
in some situations
and not in otherssupportsGetLength
in interface LastPositionFinder
LastPositionFinder.getLength()
method can be called to determine the length
of the underlying sequence.public int getLength()
LastPositionFinder
LastPositionFinder.supportsGetLength()
has been called
and has returned true.getLength
in interface LastPositionFinder
getLength
in class net.sf.saxon.expr.RangeIterator
public AtomicIterator getReverseIterator()
ReversibleIterator
getReverseIterator
in interface ReversibleIterator
getReverseIterator
in class net.sf.saxon.expr.RangeIterator
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.