Package net.sf.saxon.tree.iter
Class RangeIterator
java.lang.Object
net.sf.saxon.tree.iter.RangeIterator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SequenceIterator
,GroundedIterator
- Direct Known Subclasses:
AscendingRangeIterator
,BigRangeIterator
,DescendingRangeIterator
This abstract class represents an iteration over the results of a range expression
(A by B to C). There are implementations for ascending and descending iterators,
implemented separately for integer ranges within the 64-bit long range, and
for ranges that might include larger integers.
As well as being able to deliver a sequence of integers, these iterators also allow testing the length of the sequence returned, for the existence of a particular value, for the minimum and maximum values, for the first and last values, and for the Nth value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsEq
(NumericValue val) Ask whether the iterator will deliver a value equal to a supplied valueabstract IntegerValue
getFirst()
abstract IntegerValue
getLast()
abstract IntegerValue
getMax()
abstract IntegerValue
getMin()
abstract GroundedValue
Return a GroundedValue containing all the remaining items in the sequence returned by this SequenceIterator, starting at the current position.abstract IntegerValue
getStep()
Get the increment between successive values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.saxon.tree.iter.GroundedIterator
isActuallyGrounded, materialize
Methods inherited from interface net.sf.saxon.om.SequenceIterator
close, next
-
Constructor Details
-
Method Details
-
getResidue
Return a GroundedValue containing all the remaining items in the sequence returned by this SequenceIterator, starting at the current position. This should be an "in-memory" value, not a Closure. This method does not change the state of the iterator (in particular, it does not consume the iterator).- Specified by:
getResidue
in interfaceGroundedIterator
- Returns:
- the corresponding Value
- Throws:
UncheckedXPathException
- in the cases of subclasses (such as the iterator over a MemoClosure) which cause evaluation of expressions while materializing the value.
-
getFirst
-
getLast
-
getMin
-
getMax
-
getStep
Get the increment between successive values. For a descending iterator this will be negatiive value.- Returns:
- the increment between successive values
-
containsEq
Ask whether the iterator will deliver a value equal to a supplied value- Parameters:
val
- the supplied value- Returns:
- true if the value is one of those that the iterator will deliver
-