public final class ListIterator extends Object implements AxisIterator, LastPositionFinder, LookaheadIterator, GroundedIterator
Modifier and Type | Field and Description |
---|---|
(package private) Item |
current |
(package private) int |
index |
(package private) int |
length |
(package private) List |
list |
ATOMIZABLE, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
Constructor and Description |
---|
ListIterator(List list)
Create a ListIterator over a given List
|
ListIterator(List list,
int length)
Create a ListIterator over the leading part of a given List
|
Modifier and Type | Method and Description |
---|---|
Item |
current()
Get the current item in the sequence.
|
SequenceIterator |
getAnother()
Get another iterator over the same sequence of items, positioned at the
start of the sequence.
|
int |
getLastPosition()
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.
|
boolean |
hasNext()
Determine whether there are more items to come.
|
Value |
materialize()
Return a SequenceValue containing all the items in the sequence returned by this
SequenceIterator
|
Item |
next()
Get the next item in the sequence.
|
int |
position()
Get the current position
|
public ListIterator(List list)
list
- the list: all objects in the list must be instances of Item
public boolean hasNext()
LookaheadIterator
SequenceIterator.LOOKAHEAD
hasNext
in interface LookaheadIterator
public Item next()
AxisIterator
next
in interface AxisIterator
next
in interface SequenceIterator
public Item current()
AxisIterator
current
in interface AxisIterator
current
in interface SequenceIterator
public int position()
AxisIterator
position
in interface AxisIterator
position
in interface SequenceIterator
public int getLastPosition()
LastPositionFinder
SequenceIterator.LAST_POSITION_FINDER
getLastPosition
in interface LastPositionFinder
public SequenceIterator getAnother()
AxisIterator
getAnother
in interface AxisIterator
getAnother
in interface SequenceIterator
public int getProperties()
getProperties
in interface SequenceIterator
GROUNDED
, LAST_POSITION_FINDER
,
and 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 Value materialize()
materialize
in interface GroundedIterator