net.sf.saxon.expr

Class ItemMappingIterator

Implemented Interfaces:
SequenceIterator

public final class ItemMappingIterator
extends java.lang.Object
implements SequenceIterator

ItemMappingIterator applies a mapping function to each item in a sequence. The mapping function either returns a single item, or null (representing an empty sequence).

This is a specialization of the more general MappingIterator class, for use in cases where a single input item never maps to a sequence of more than one output item.

Fields inherited from interface net.sf.saxon.om.SequenceIterator

GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD

Constructor Summary

ItemMappingIterator(SequenceIterator base, ItemMappingFunction action)
Construct an ItemMappingIterator that will apply a specified ItemMappingFunction to each Item returned by the base iterator.

Method Summary

Item
current()
SequenceIterator
getAnother()
int
getProperties()
Get properties of this iterator, as a bit-significant integer.
Item
next()
int
position()

Constructor Details

ItemMappingIterator

public ItemMappingIterator(SequenceIterator base,
                           ItemMappingFunction action)
Construct an ItemMappingIterator that will apply a specified ItemMappingFunction to each Item returned by the base iterator.
Parameters:
base - the base iterator
action - the mapping function to be applied

Method Details

current

public Item current()
Specified by:
current in interface SequenceIterator

getAnother

public SequenceIterator getAnother()
            throws XPathException
Specified by:
getAnother in interface SequenceIterator

getProperties

public int getProperties()
Get properties of this iterator, as a bit-significant integer.
Specified by:
getProperties in interface SequenceIterator
Returns:
the properties of this iterator. This will be some combination of properties such as 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.

next

public Item next()
            throws XPathException
Specified by:
next in interface SequenceIterator

position

public int position()
Specified by:
position in interface SequenceIterator