net.sf.saxon.evpull

Class EventStackIterator

Implemented Interfaces:
EventIterator, PullEvent

public class EventStackIterator
extends java.lang.Object
implements EventIterator

An EventStackIterator is an EventIterator that delivers a flat sequence of PullEvents containing no nested EventIterators

Method Summary

static EventIterator
flatten(EventIterator base)
Factory method to create an iterator that flattens the sequence of PullEvents received from a base iterator, that is, it returns an EventIterator that will never return any nested iterators.
boolean
isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators
PullEvent
next()
Get the next event in the sequence.

Method Details

flatten

public static EventIterator flatten(EventIterator base)
Factory method to create an iterator that flattens the sequence of PullEvents received from a base iterator, that is, it returns an EventIterator that will never return any nested iterators.
Parameters:
base - the base iterator. Any nested EventIterator returned by the base iterator will be flattened, recursively.

isFlatSequence

public boolean isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators
Specified by:
isFlatSequence in interface EventIterator
Returns:
true if the next() method is guaranteed never to return an EventIterator

next

public PullEvent next()
            throws XPathException
Get the next event in the sequence. This will never be an EventIterator.
Specified by:
next in interface EventIterator
Returns:
the next event, or null when the sequence is exhausted
Throws:
XPathException - if a dynamic evaluation error occurs