public class ListIterator<T extends Item<?>> extends java.lang.Object implements UnfailingIterator<T>, LastPositionFinder, LookaheadIterator<T>, GroundedIterator<T>, ReversibleIterator<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
ListIterator.Atomic |
static class |
ListIterator.OfNodes |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<T> |
list |
ATOMIZING, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD| Constructor and Description |
|---|
ListIterator(java.util.List<T> list)
Create a ListIterator over a given List
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLength()
Get the last position (that is, the number of items in the sequence).
|
int |
getProperties()
Get properties of this iterator, as a bit-significant integer.
|
GroundedValue<T> |
getResidue()
Return a GroundedValue containing all the remaining items in the sequence returned by this
SequenceIterator, starting at the current position.
|
SequenceIterator<T> |
getReverseIterator()
Get a new SequenceIterator that returns the same items in reverse order.
|
boolean |
hasNext()
Determine whether there are more items to come.
|
GroundedValue<T> |
materialize()
Return a Sequence containing all the items in the sequence returned by this
SequenceIterator
|
T |
next()
Get the next item in the sequence.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfirstWith, forEach, toGroundedValue, toListclose, forEachOrFailpublic boolean hasNext()
LookaheadIteratorThis method must not be called unless the result of getProperties() on the iterator
includes the bit setting SequenceIterator.LOOKAHEAD
hasNext in interface LookaheadIterator<T extends Item<?>>public T next()
UnfailingIteratornext in interface SequenceIterator<T extends Item<?>>next in interface UnfailingIterator<T extends Item<?>>public int getLength()
LastPositionFinderSequenceIterator.LAST_POSITION_FINDERgetLength in interface LastPositionFinderpublic int getProperties()
getProperties in interface SequenceIterator<T extends Item<?>>SequenceIterator.GROUNDED, SequenceIterator.LAST_POSITION_FINDER,
and SequenceIterator.LOOKAHEAD. It is always
acceptable to return the value zero, indicating that there are no known special properties.
It is acceptable for the properties of the iterator to change depending on its state.public GroundedValue<T> materialize()
materialize in interface SequenceIterator<T extends Item<?>>materialize in interface GroundedIterator<T extends Item<?>>public GroundedValue<T> getResidue()
GroundedIteratorgetResidue in interface GroundedIterator<T extends Item<?>>public SequenceIterator<T> getReverseIterator()
ReversibleIteratorgetReverseIterator in interface ReversibleIterator<T extends Item<?>>Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.