net.sf.saxon.event

Class SequenceOutputter

public final class SequenceOutputter extends SequenceWriter

This outputter is used when writing a sequence of atomic values and nodes, that is, when xsl:variable is used with content and an "as" attribute. The outputter builds the sequence and provides access to it. (It isn't really an outputter at all, it doesn't pass the events to anyone, it merely constructs the sequence in memory and provides access to it). Note that the event sequence can include calls such as startElement and endElement that require trees to be built. If nodes such as attributes and text nodes are received while an element is being constructed, the nodes are added to the tree. Otherwise, "orphan" nodes (nodes with no parent) are created and added directly to the sequence.

This class is not used to build temporary trees. For that, the ComplexContentOutputter is used.

Author: Michael H. Kay

Constructor Summary
SequenceOutputter()
Create a new SequenceOutputter
SequenceOutputter(Controller controller, int estimatedSize)
SequenceOutputter(Controller controller)
Method Summary
ItemgetFirstItem()
Get the first item in the sequence that has been built
ArrayListgetList()
Get the list containing the sequence of items
ValueRepresentationgetSequence()
Get the sequence that has been built
SequenceIteratoriterate()
Get an iterator over the sequence of items that has been constructed
ItempopLastItem()
Get the last item in the sequence that has been built, and remove it
voidreset()
Clear the contents of the SequenceOutputter and make it available for reuse
voidwrite(Item item)
Abstract method to be supplied by subclasses: output one item in the sequence.

Constructor Detail

SequenceOutputter

public SequenceOutputter()
Create a new SequenceOutputter

SequenceOutputter

public SequenceOutputter(Controller controller, int estimatedSize)

SequenceOutputter

public SequenceOutputter(Controller controller)

Method Detail

getFirstItem

public Item getFirstItem()
Get the first item in the sequence that has been built

getList

public ArrayList getList()
Get the list containing the sequence of items

getSequence

public ValueRepresentation getSequence()
Get the sequence that has been built

iterate

public SequenceIterator iterate()
Get an iterator over the sequence of items that has been constructed

popLastItem

public Item popLastItem()
Get the last item in the sequence that has been built, and remove it

reset

public void reset()
Clear the contents of the SequenceOutputter and make it available for reuse

write

public void write(Item item)
Abstract method to be supplied by subclasses: output one item in the sequence.