net.sf.saxon.om

Class ListIterator

public final class ListIterator extends Object implements AxisIterator, LastPositionFinder, LookaheadIterator, GroundedIterator

Class ListIterator, iterates over a sequence of items held in a Java ArrayList, or indeed in any other kind of List
Field Summary
Itemcurrent
intindex
intlength
Listlist
Constructor Summary
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
Method Summary
Itemcurrent()
SequenceIteratorgetAnother()
intgetLastPosition()
intgetProperties()
Get properties of this iterator, as a bit-significant integer.
booleanhasNext()
Valuematerialize()
Return a SequenceValue containing all the items in the sequence returned by this SequenceIterator
Itemnext()
intposition()

Field Detail

current

Item current

index

int index

length

int length

list

List list

Constructor Detail

ListIterator

public ListIterator(List list)
Create a ListIterator over a given List

Parameters: 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

Parameters: list the list: all objects in the list must be instances of Item length: the number of items to be included

Method Detail

current

public Item current()

getAnother

public SequenceIterator getAnother()

getLastPosition

public int getLastPosition()

getProperties

public int getProperties()
Get properties of this iterator, as a bit-significant integer.

Returns: the properties of this iterator. This will be some combination of properties such as 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.

hasNext

public boolean hasNext()

materialize

public Value materialize()
Return a SequenceValue containing all the items in the sequence returned by this SequenceIterator

Returns: the corresponding SequenceValue

next

public Item next()

position

public int position()