Package net.sf.saxon.functions
Class Reverse.ReverseListIterator
- java.lang.Object
-
- net.sf.saxon.functions.Reverse.ReverseListIterator
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,LastPositionFinder,SequenceIterator,ReversibleIterator
- Enclosing class:
- Reverse
public static class Reverse.ReverseListIterator extends java.lang.Object implements SequenceIterator, LastPositionFinder, ReversibleIterator
-
-
Constructor Summary
Constructors Constructor Description ReverseListIterator(java.util.List<T> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLength()Get the last position (that is, the number of items in the sequence).SequenceIteratorgetReverseIterator()Get a new SequenceIterator that returns the same items in reverse order.Itemnext()Get the next item in the sequence.booleansupportsGetLength()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, discharge
-
-
-
-
Method Detail
-
supportsGetLength
public boolean supportsGetLength()
Description copied from interface:LastPositionFinderAsk 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:
supportsGetLengthin 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:
getLengthin interfaceLastPositionFinder- Returns:
- the number of items in the sequence
-
next
public Item next()
Get the next item in the sequence.- Specified by:
nextin interfaceSequenceIterator- Returns:
- the next Item. If there are no more items, return null.
-
getReverseIterator
public SequenceIterator 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:
getReverseIteratorin interfaceReversibleIterator- Returns:
- an iterator over the items in reverse order
-
-