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 int
getLength()
Get the last position (that is, the number of items in the sequence).SequenceIterator
getReverseIterator()
Get a new SequenceIterator that returns the same items in reverse order.Item
next()
Get the next item in the sequence.boolean
supportsGetLength()
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
-
-
-
-
Method Detail
-
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
public Item 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
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:
getReverseIterator
in interfaceReversibleIterator
- Returns:
- an iterator over the items in reverse order
-
-