net.sf.saxon.om
Class ListIterator
java.lang.Object
net.sf.saxon.om.ListIterator
- GroundedIterator, LastPositionFinder, LookaheadIterator, SequenceIterator, UnfailingIterator
public class ListIterator
extends java.lang.Object
Class ListIterator, iterates over a sequence of items held in a Java ArrayList,
or indeed in any other kind of List
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
|
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.
|
GroundedValue | 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
|
ListIterator
public ListIterator(List list)
Create a ListIterator over a given List
list
- the list: all objects in the list must be instances of Item
ListIterator
public ListIterator(List list,
int length)
Create a ListIterator over the leading part of a given List
list
- the list: all objects in the list must be instances of Item
length
- the number of items to be included
getAnother
public SequenceIterator getAnother()
Get another iterator over the same sequence of items, positioned at the
start of the sequence. It must be possible to call this method at any time, whether
none, some, or all of the items in the original iterator have been read. The method
is non-destructive: it does not change the state of the original iterator.
- getAnother in interface UnfailingIterator
- getAnother in interface SequenceIterator
- a new iterator over the same sequence
getLastPosition
public int getLastPosition()
Get the last position (that is, the number of items in the sequence). This method is
non-destructive: it does not change the state of the iterator.
The result is undefined if the next() method of the iterator has already returned null.
This method must not be called unless the result of getProperties() on the iterator
includes the bit setting
SequenceIterator.LAST_POSITION_FINDER
- getLastPosition in interface LastPositionFinder
getProperties
public int getProperties()
Get properties of this iterator, as a bit-significant integer.
- getProperties in interface SequenceIterator
hasNext
public boolean hasNext()
Determine whether there are more items to come. Note that this operation
is stateless and it is not necessary (or usual) to call it before calling
next(). It is used only when there is an explicit need to tell if we
are at the last element.
This method must not be called unless the result of getProperties() on the iterator
includes the bit setting
SequenceIterator.LOOKAHEAD
- hasNext in interface LookaheadIterator
- true if there are more items in the sequence
materialize
public GroundedValue materialize()
Return a SequenceValue containing all the items in the sequence returned by this
SequenceIterator
- materialize in interface GroundedIterator
- the corresponding SequenceValue