net.sf.saxon.om
public class SingletonIterator extends Object implements AxisIterator, ReversibleIterator, LastPositionFinder, GroundedIterator, LookaheadIterator, AtomizableIterator
Method Summary | |
---|---|
Item | current() |
SequenceIterator | getAnother() |
int | getLastPosition() |
int | getProperties()
Get properties of this iterator, as a bit-significant integer.
|
SequenceIterator | getReverseIterator() |
Item | getValue() |
boolean | hasNext()
Determine whether there are more items to come. |
static AxisIterator | makeIterator(Item item)
Factory method. |
Value | materialize()
Return a SequenceExtent containing all the items in the sequence returned by this
SequenceIterator
|
Item | next() |
int | position()
Return the current position in the sequence. |
void | setIsAtomizing(boolean atomizing)
Indicate that any nodes returned in the sequence will be atomized. |
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.
Returns: true if there are more items
Parameters: item the item to iterate over
Returns: a SingletonIterator over the supplied item, or an EmptyIterator if the supplied item is null.
Returns: the corresponding SequenceExtent if it exists, or null if it doesn't; in this case the caller must construct a new SequenceExtent by calling new SequenceExtent(iter.getAnother())
Returns: 0 before the first call on next(); 1 before the second call on next(); -1 after the second call on next().
This implementation attempts atomization of a singleton node if it is untyped. This avoids adding an iterator to iterate over the value in the common case where the typed value of the node is a single atomic value.
Parameters: atomizing true if the caller of this iterator will atomize any nodes that are returned, and is therefore willing to accept the typed value of the nodes instead of the nodes themselves.