public final class TinyTree extends Object implements LocationProvider
It can be used to represent a tree that is rooted at a document node, or one that is rooted at an element node.
Modifier and Type | Field and Description |
---|---|
protected int[] |
alpha |
protected int[] |
attCode |
protected int[] |
attParent |
protected int[] |
attTypeCode |
protected AtomicSequence[] |
attTypedValue |
protected CharSequence[] |
attValue |
protected int[] |
beta |
protected AppendableCharSequence |
charBuffer |
protected FastStringBuffer |
commentBuffer |
protected short[] |
depth |
protected long |
documentNumber |
protected int[] |
nameCode |
protected NamespaceBinding[] |
namespaceBinding |
protected int[] |
namespaceParent |
protected int[] |
next |
byte[] |
nodeKind |
protected int |
numberOfAttributes |
protected int |
numberOfNamespaces |
protected int |
numberOfNodes |
protected int[] |
prior |
protected int |
rootIndexUsed |
static int |
TYPECODE_IDREF |
protected int[] |
typeCodeArray |
protected AtomicSequence[] |
typedValueArray |
protected boolean |
usesNamespaces |
Constructor and Description |
---|
TinyTree(Configuration config,
Statistics statistics)
Create a tree with a specified initial size
|
Modifier and Type | Method and Description |
---|---|
int |
addTextNodeCopy(int depth,
int existingNodeNr)
Create a new text node that is a copy of an existing text node
|
void |
diagnosticDump()
Produce diagnostic print of main tree arrays
|
static void |
diagnosticDump(NodeInfo node)
Create diagnostic dump of the tree containing a particular node.
|
int[] |
getAlphaArray()
Get the array holding alpha information
|
int[] |
getAttributeNameCodeArray()
Get the array used to hold the name codes of all attributes
|
int[] |
getAttributeParentArray()
Get the array used to hold the parent pointers of all attributes
|
int[] |
getAttributeTypeCodeArray()
Get the array used to hold the type codes of all attributes
|
CharSequence[] |
getAttributeValueArray()
Get the array used to hold the name codes of all attributes
|
int[] |
getBetaArray()
Get the array holding beta information
|
AppendableCharSequence |
getCharacterBuffer()
Get the character buffer used to hold all the text data of the document
|
int |
getColumnNumber(int sequence)
Get the column number for a node.
|
CharSequence |
getCommentBuffer()
Get the character buffer used to hold all the comment data of the document
|
Configuration |
getConfiguration()
Get the configuration previously set using setConfiguration
|
long |
getDocumentNumber()
Get the document number (actually, the tree number)
|
int |
getLineNumber(int sequence)
Get the line number for a node.
|
int |
getNameCode(int nodeNr)
Get the nameCode for a given node, which must be a document, element,
text, comment, or processing instruction node
|
int[] |
getNameCodeArray()
Get the array holding node name information
|
NamePool |
getNamePool()
Get the name pool used for the names in this document
|
NamespaceBinding[] |
getNamespaceBindings()
Get the array used to hold the namespace declarations
|
int[] |
getNamespaceParentArray()
Get the array used to hold the parent pointers of all namespace declarations
|
int[] |
getNextPointerArray()
Get the array holding next-sibling pointers
|
TinyNodeImpl |
getNode(int nr)
Get the node at a given position in the tree
|
short[] |
getNodeDepthArray()
Get the array holding node depth information
|
int |
getNodeKind(int nodeNr)
Get the node kind of a given node, which must be a document, element,
text, comment, or processing instruction node
|
byte[] |
getNodeKindArray()
Get the array holding node kind information
|
int |
getNumberOfAttributes()
Get the number of attributes in the tree
|
int |
getNumberOfNamespaces()
Get the number of namespace declarations in the tree
|
int |
getNumberOfNodes()
Get the number of nodes in the tree, excluding attributes and namespace nodes
|
String |
getSystemId(int seq)
Get the system id of an element in the document
|
int |
getTypeAnnotation(int nodeNr)
Get the type annotation of a node.
|
int[] |
getTypeCodeArray()
Get the array holding node type information
|
AtomicSequence |
getTypedValueOfAttribute(net.sf.saxon.tree.tiny.TinyAttributeImpl att,
int nodeNr)
Get the typed value of an attribute node.
|
AtomicSequence |
getTypedValueOfElement(int nodeNr)
Get the type value of an element node, given only the node number
|
AtomicSequence |
getTypedValueOfElement(TinyElementImpl element)
Get the typed value of an element node.
|
void |
indexIDElement(NodeInfo root,
int nodeNr)
Index an element of type xs:ID
|
boolean |
isIdAttribute(int nr)
Determine whether an attribute is an IDREF/IDREFS attribute.
|
boolean |
isIdElement(int nr)
Ask whether an element is an ID element.
|
boolean |
isIdrefAttribute(int nr)
Determine whether an attribute is an IDREF/IDREFS attribute.
|
boolean |
isIdrefElement(int nr)
Ask whether an element is an IDREF/IDREFS element.
|
boolean |
isNilled(int nodeNr)
Ask whether a given node is nilled
|
void |
setConfiguration(Configuration config)
Set the Configuration that contains this document
|
void |
setLineNumbering()
Set line numbering on
|
void |
showSize()
Output a statistical summary to System.err
|
protected long documentNumber
protected AppendableCharSequence charBuffer
protected FastStringBuffer commentBuffer
protected int numberOfNodes
public byte[] nodeKind
protected short[] depth
protected int[] next
protected int[] alpha
protected int[] beta
protected int[] nameCode
protected int[] prior
protected int[] typeCodeArray
protected AtomicSequence[] typedValueArray
public static final int TYPECODE_IDREF
protected int numberOfAttributes
protected int[] attParent
protected int[] attCode
protected CharSequence[] attValue
protected AtomicSequence[] attTypedValue
protected int[] attTypeCode
protected int numberOfNamespaces
protected int[] namespaceParent
protected NamespaceBinding[] namespaceBinding
protected int rootIndexUsed
protected boolean usesNamespaces
public TinyTree(Configuration config, Statistics statistics)
config
- the Saxon configurationstatistics
- the size parameters for the treepublic void setConfiguration(Configuration config)
config
- the Saxon configurationpublic Configuration getConfiguration()
public NamePool getNamePool()
public int addTextNodeCopy(int depth, int existingNodeNr)
depth
- the depth of the new nodeexistingNodeNr
- the node to be copiedpublic int getTypeAnnotation(int nodeNr)
nodeNr
- the node whose type annotation is requiredpublic AtomicSequence getTypedValueOfElement(TinyElementImpl element) throws XPathException
element
- the element nodeXPathException
- if a dynamic error occurs, for example if the node is
an element annotated with a type that has element-only contentpublic AtomicSequence getTypedValueOfElement(int nodeNr) throws XPathException
nodeNr
- the node number of the element nodeXPathException
- if the eement has no typed valuepublic AtomicSequence getTypedValueOfAttribute(net.sf.saxon.tree.tiny.TinyAttributeImpl att, int nodeNr) throws XPathException
att
- the attribute node if available. If null is supplied, the attribute node
will be materialized only if it is needed.nodeNr
- the node number of the attribute nodeXPathException
- if an error is foundpublic int getNodeKind(int nodeNr)
nodeNr
- the node numberpublic int getNameCode(int nodeNr)
nodeNr
- the node numberpublic void indexIDElement(NodeInfo root, int nodeNr)
root
- the root node of the documentnodeNr
- the element of type xs:IDpublic final TinyNodeImpl getNode(int nr)
nr
- the node numberpublic boolean isIdAttribute(int nr)
nr
- the node number of the attributepublic boolean isIdrefAttribute(int nr)
nr
- the node number of the attributepublic boolean isIdElement(int nr)
nr
- the element node whose is-idref property is requiredpublic boolean isIdrefElement(int nr)
nr
- the element node whose is-idref property is requiredpublic String getSystemId(int seq)
getSystemId
in interface LocationProvider
seq
- the node number of the element nodepublic void setLineNumbering()
public int getLineNumber(int sequence)
getLineNumber
in interface LocationProvider
sequence
- the node numberpublic int getColumnNumber(int sequence)
getColumnNumber
in interface LocationProvider
sequence
- the node numberpublic long getDocumentNumber()
public boolean isNilled(int nodeNr)
nodeNr
- the node in question (which must be an element node)public void diagnosticDump()
public static void diagnosticDump(NodeInfo node)
node
- the node in questionpublic void showSize()
public int getNumberOfNodes()
public int getNumberOfAttributes()
public int getNumberOfNamespaces()
public byte[] getNodeKindArray()
public short[] getNodeDepthArray()
public int[] getNameCodeArray()
public int[] getTypeCodeArray()
public int[] getNextPointerArray()
public int[] getAlphaArray()
public int[] getBetaArray()
public AppendableCharSequence getCharacterBuffer()
public CharSequence getCommentBuffer()
public int[] getAttributeNameCodeArray()
public int[] getAttributeTypeCodeArray()
public int[] getAttributeParentArray()
public CharSequence[] getAttributeValueArray()
public NamespaceBinding[] getNamespaceBindings()
public int[] getNamespaceParentArray()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.