Package net.sf.saxon.tinytree
Class TinyTreeEventIterator
- java.lang.Object
-
- net.sf.saxon.tinytree.TinyTreeEventIterator
-
- All Implemented Interfaces:
LocationProvider
,EventIterator
,PullEvent
public class TinyTreeEventIterator extends java.lang.Object implements EventIterator, LocationProvider
This implementation of the Saxon event-pull interface starts from a document, element, text, comment, or processing-instruction node in a TinyTree, and returns the events corresponding to that node and its descendants (including their attributes and namespaces). The class performs the same function as the general-purposeDecomposer
class, but is specialized to exploit the TinyTree data structure: in particular, it never materializes any Node objects.
-
-
Constructor Summary
Constructors Constructor Description TinyTreeEventIterator(TinyNodeImpl startNode, PipelineConfiguration pipe)
Create a TinyTreeEventIterator to return events associated with a tree or subtree
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnNumber(long locationId)
Get location information: the column number of the current start element eventint
getLineNumber(long locationId)
Get location information: the line number of the current start element eventjava.lang.String
getSystemId(long locationId)
Get location information: the system Id of the current start element eventboolean
isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iteratorsPullEvent
next()
Get the next event
-
-
-
Constructor Detail
-
TinyTreeEventIterator
public TinyTreeEventIterator(TinyNodeImpl startNode, PipelineConfiguration pipe)
Create a TinyTreeEventIterator to return events associated with a tree or subtree- Parameters:
startNode
- the root of the tree or subtree. Must be a document or element node.pipe
- the Saxon pipeline configuration- Throws:
java.lang.IllegalArgumentException
- if the start node is an attribute or namespace node.
-
-
Method Detail
-
next
public PullEvent next() throws XPathException
Get the next event- Specified by:
next
in interfaceEventIterator
- Returns:
- a PullEvent object representing the next event, or null when the sequence is exhausted
- 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:
isFlatSequence
in interfaceEventIterator
- Returns:
- true if the next() method is guaranteed never to return an EventIterator
-
getSystemId
public java.lang.String getSystemId(long locationId)
Get location information: the system Id of the current start element event- Specified by:
getSystemId
in interfaceLocationProvider
- Parameters:
locationId
- in this case, the node number in the tiny tree- Returns:
- the system Id of the node: that is its base URI, before taking xml:base into account
-
getLineNumber
public int getLineNumber(long locationId)
Get location information: the line number of the current start element event- Specified by:
getLineNumber
in interfaceLocationProvider
- Parameters:
locationId
- in this case, the node number in the tiny tree- Returns:
- the line number of the node if known, or -1 otherwise
-
getColumnNumber
public int getColumnNumber(long locationId)
Get location information: the column number of the current start element event- Specified by:
getColumnNumber
in interfaceLocationProvider
- Parameters:
locationId
- in this case, the node number in the tiny tree- Returns:
- the column number of the node if known, or -1 otherwise
-
-