A data structure to hold the contents of a tree. As the name implies, this implementation
of the data model is optimized for size, and for speed of creation: it minimizes the number
of Java objects used.
It can be used to represent a tree that is rooted at a document node, or one that is rooted
at an element node.
alpha
protected int[] alpha
attCode
protected int[] attCode
attParent
protected int[] attParent
attTypeCode
protected int[] attTypeCode
attValue
protected CharSequence[] attValue
depth
protected short[] depth
documentNumber
protected int documentNumber
nameCode
protected int[] nameCode
namespaceCode
protected int[] namespaceCode
namespaceParent
protected int[] namespaceParent
nodeKind
public byte[] nodeKind
numberOfAttributes
protected int numberOfAttributes
numberOfNamespaces
protected int numberOfNamespaces
numberOfNodes
protected int numberOfNodes
prior
protected int[] prior
rootIndexUsed
protected int rootIndexUsed
typeCodeArray
protected int[] typeCodeArray
usesNamespaces
protected boolean usesNamespaces
diagnosticDump
public void diagnosticDump()
Produce diagnostic print of main tree arrays
diagnosticDump
public static void diagnosticDump(NodeInfo node)
Create diagnostic dump of the tree containing a particular node.
Designed to be called as an extension function for diagnostics.
node
- the node in question
getAlphaArray
public int[] getAlphaArray()
Get the array holding alpha information
- an array of integers, whose meaning depends on the node kind. For elements it is a pointer
to the first attribute, for text, comment, and processing instruction nodes it is a pointer to the content
getAttributeNameCodeArray
public int[] getAttributeNameCodeArray()
Get the array used to hold the name codes of all attributes
- an integer array; the Nth integer holds the attribute name code of attribute N
getAttributeParentArray
public int[] getAttributeParentArray()
Get the array used to hold the parent pointers of all attributes
- an integer array; the Nth integer holds the pointer to the parent element of attribute N
getAttributeTypeCodeArray
public int[] getAttributeTypeCodeArray()
Get the array used to hold the type codes of all attributes
- an integer array; the Nth integer holds the attribute type code of attribute N
getAttributeValueArray
public CharSequence[] getAttributeValueArray()
Get the array used to hold the name codes of all attributes
- an array of strings; the Nth string holds the string value of attribute N
getBetaArray
public int[] getBetaArray()
Get the array holding beta information
- an array of integers, whose meaning depends on the node kind. For elements it is a pointer
to the first namespace declaration
getCharacterBuffer
public CharSequence getCharacterBuffer()
Get the character buffer used to hold all the text data of the document
getCommentBuffer
public CharSequence getCommentBuffer()
Get the character buffer used to hold all the comment data of the document
- the character buffer used for comments
getConfiguration
public Configuration getConfiguration()
Get the configuration previously set using setConfiguration
getDocumentNumber
public int getDocumentNumber()
Get the document number (actually, the tree number)
- the unique number of this TinyTree structure
getNameCode
public int getNameCode(int nodeNr)
Get the nameCode for a given node, which must be a document, element,
text, comment, or processing instruction node
getNameCodeArray
public int[] getNameCodeArray()
Get the array holding node name information
- an array of integers, integer N is the name code of node number N
getNamePool
public NamePool getNamePool()
Get the name pool used for the names in this document
getNamespaceCodeArray
public int[] getNamespaceCodeArray()
Get the array used to hold the namespace codes of namespace declarations
- an array of integer namespace codes
getNamespaceParentArray
public int[] getNamespaceParentArray()
Get the array used to hold the parent pointers of all namespace declarations
- an integer array; the Nth integer holds the pointer to the parent element of namespace N
getNextPointerArray
public int[] getNextPointerArray()
Get the array holding next-sibling pointers
- an array of integers, integer N is the next-sibling pointer for node number N
getNode
public final TinyNodeImpl getNode(int nr)
Get the node at a given position in the tree
- the node at the given position
getNodeDepthArray
public short[] getNodeDepthArray()
Get the array holding node depth information
- an array of shorts, byte N is the node depth of node number N
getNodeKind
public int getNodeKind(int nodeNr)
Get the node kind of a given node, which must be a document, element,
text, comment, or processing instruction node
getNodeKindArray
public byte[] getNodeKindArray()
Get the array holding node kind information
- an array of bytes, byte N is the node kind of node number N
getNumberOfAttributes
public int getNumberOfAttributes()
Get the number of attributes in the tree
getNumberOfNamespaces
public int getNumberOfNamespaces()
Get the number of namespace declarations in the tree
- the number of namespace declarations
getNumberOfNodes
public int getNumberOfNodes()
Get the number of nodes in the tree, excluding attributes and namespace nodes
getTypeAnnotation
public int getTypeAnnotation(int nodeNr)
Get the type annotation of a node. Applies only to document, element, text,
processing instruction, and comment nodes.
nodeNr
- the node whose type annotation is required
- the fingerprint of the type annotation for elements and attributes, otherwise undefined.
getTypeCodeArray
public int[] getTypeCodeArray()
Get the array holding node type information
- an array of integers, integer N is the type code of node number N
indexIDElement
public void indexIDElement(NodeInfo root,
int nodeNr,
NameChecker checker)
Index an element of type xs:ID
root
- the root node of the documentnodeNr
- the element of type xs:IDchecker
- checks names against XML 1.0 or XML 1.1 rules
isIdrefAttribute
public boolean isIdrefAttribute(int nr)
Determine whether an attribute is an IDREF/IDREFS attribute. (The represents the
is-idref property in the data model)
nr
- the node number of the attribute
- true if this is an IDREF/IDREFS attribute
isIdrefElement
public boolean isIdrefElement(int nr)
Ask whether an element is an IDREF/IDREFS element. (The represents the
is-idref property in the data model)
nr
- the element node whose is-idref property is required
- true if the node has the is-idref property
isNilled
public boolean isNilled(int nodeNr)
Ask whether a given node is nilled
nodeNr
- the node in question
- true if the node has the nilled property
setConfiguration
public void setConfiguration(Configuration config)
Set the Configuration that contains this document
config
- the Saxon configuration
setLineNumbering
public void setLineNumbering()
Set line numbering on
showSize
public void showSize()
Output a statistical summary to System.err