Package net.sf.saxon.evpull
Class EventMappingIterator
- java.lang.Object
-
- net.sf.saxon.evpull.EventMappingIterator
-
- All Implemented Interfaces:
EventIterator,PullEvent
public final class EventMappingIterator extends java.lang.Object implements EventIterator
MappingIterator merges a sequence of sequences into a single sequence. It takes as inputs an iteration, and a mapping function to be applied to each Item returned by that iteration. The mapping function itself returns another iteration. The result is an iteration of iterators. To convert this int a single flat iterator over a uniform sequence of events, the result must be wrapped in anEventStackIterator
-
-
Constructor Summary
Constructors Constructor Description EventMappingIterator(SequenceIterator base, EventMappingFunction action)Construct a MappingIterator that will apply a specified MappingFunction to each Item returned by the base iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFlatSequence()Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iteratorsPullEventnext()Get the next event in the sequence
-
-
-
Constructor Detail
-
EventMappingIterator
public EventMappingIterator(SequenceIterator base, EventMappingFunction action)
Construct a MappingIterator that will apply a specified MappingFunction to each Item returned by the base iterator.- Parameters:
base- the base iteratoraction- the mapping function to be applied
-
-
Method Detail
-
next
public PullEvent next() throws XPathException
Description copied from interface:EventIteratorGet the next event in the sequence- Specified by:
nextin interfaceEventIterator- Returns:
- the next event, or null when the sequence is exhausted. Note that since an EventIterator is itself a PullEvent, this method may return a nested iterator.
- Throws:
XPathException- if a dynamic evaluation error occurs
-
isFlatSequence
public boolean isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators- Specified by:
isFlatSequencein interfaceEventIterator- Returns:
- true if the next() method is guaranteed never to return an EventIterator
-
-