Package net.sf.saxon.functions
Class Reverse.ReverseListIterator
java.lang.Object
net.sf.saxon.functions.Reverse.ReverseListIterator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,LastPositionFinder
,SequenceIterator
,ReversibleIterator
- Enclosing class:
Reverse
public static class Reverse.ReverseListIterator
extends Object
implements SequenceIterator, LastPositionFinder, ReversibleIterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the last position (that is, the number of items in the sequence).Get a new SequenceIterator that returns the same items in reverse order.next()
Get the next item in the sequence.boolean
Ask whether this iterator supports use of theLastPositionFinder.getLength()
method.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.om.SequenceIterator
close
-
Constructor Details
-
ReverseListIterator
-
-
Method Details
-
supportsGetLength
public boolean supportsGetLength()Description copied from interface:LastPositionFinder
Ask whether this iterator supports use of theLastPositionFinder.getLength()
method. This method should always be called before callingLastPositionFinder.getLength()
, because an iterator that implements this interface may support use ofLastPositionFinder.getLength()
in some situations and not in others- Specified by:
supportsGetLength
in interfaceLastPositionFinder
- Returns:
- true if the
LastPositionFinder.getLength()
method can be called to determine the length of the underlying sequence.
-
getLength
public int getLength()Get the last position (that is, the number of items in the sequence).- Specified by:
getLength
in interfaceLastPositionFinder
- Returns:
- the number of items in the sequence
-
next
Get the next item in the sequence.- Specified by:
next
in interfaceSequenceIterator
- Returns:
- the next Item. If there are no more items, return null.
-
getReverseIterator
Get a new SequenceIterator that returns the same items in reverse order. If this SequenceIterator is an AxisIterator, then the returned SequenceIterator must also be an AxisIterator.- Specified by:
getReverseIterator
in interfaceReversibleIterator
- Returns:
- an iterator over the items in reverse order
-