net.sf.saxon.tinytree
public final class TinyTree extends Object
It can be used to represent a tree that is rooted at a document node, or one that is rooted at an element node.
Field Summary | |
---|---|
protected int[] | alpha |
protected int[] | attCode |
protected int[] | attParent |
protected int[] | attTypeCode |
protected CharSequence[] | attValue |
protected int[] | beta |
protected LargeStringBuffer | charBuffer |
protected FastStringBuffer | commentBuffer |
protected short[] | depth |
protected int | documentNumber |
protected int[] | nameCode |
protected int[] | namespaceCode |
protected int[] | namespaceParent |
protected int[] | next |
byte[] | nodeKind |
protected int | numberOfAttributes |
protected int | numberOfNamespaces |
protected int | numberOfNodes |
protected int[] | prior |
protected int[] | typeCodeArray |
protected boolean | usesNamespaces |
Constructor Summary | |
---|---|
TinyTree() | |
TinyTree(int nodes, int attributes, int namespaces, int characters) |
Method Summary | |
---|---|
void | addAttribute(NodeInfo root, int parent, int nameCode, int typeCode, CharSequence attValue) |
void | addDocumentNode(TinyDocumentImpl doc)
Add a document node to the tree. |
void | addNamespace(int parent, int nscode)
Add a namespace node to the current element |
int | addNode(short kind, int depth, int alpha, int beta, int nameCode)
Add a node to the tree |
void | appendChars(CharSequence chars) |
protected void | condense()
Condense the tree: release unused memory. |
void | diagnosticDump()
Produce diagnostic print of main tree arrays |
void | ensurePriorIndex()
On demand, make an index for quick access to preceding-sibling nodes |
int[] | getAlphaArray() |
int | getAttributeAnnotation(int nr)
Get the type annotation of an attribute node.
|
int[] | getAttributeNameCodeArray() |
TinyAttributeImpl | getAttributeNode(int nr)
Make a (transient) attribute node from the array of attributes |
int[] | getAttributeParentArray() |
int[] | getAttributeTypeCodeArray() |
CharSequence[] | getAttributeValueArray() |
int[] | getBetaArray() |
CharSequence | getCharacterBuffer() |
CharSequence | getCommentBuffer() |
Configuration | getConfiguration()
Get the configuration previously set using setConfiguration |
int | getDocumentNumber()
Get the document number (actually, the tree number) |
int | getLineNumber(int sequence)
Get the line number for an element. |
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() |
NamePool | getNamePool()
Get the name pool used for the names in this document |
int[] | getNamespaceCodeArray() |
int[] | getNamespaceParentArray() |
int[] | getNextPointerArray() |
TinyNodeImpl | getNode(int nr) |
short[] | getNodeDepthArray() |
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() |
int | getNumberOfAttributes() |
int | getNumberOfNamespaces() |
int | getNumberOfNodes()
Get the number of nodes in the tree, excluding attributes and namespace nodes |
int | getRootNode(int nodeNr)
Get the root node for a given node |
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() |
UntypedAtomicValue | getUntypedAtomicValue(int nodeNr)
Get the typed value of a node whose type is known to be untypedAtomic.
|
void | indexIDElement(NodeInfo root, int nodeNr, NameChecker checker)
Index an element of type xs:ID |
boolean | isIdref(int nr)
Determine whether an attribute is an IDREF/IDREFS attribute. |
boolean | isIDCode(int typeCode)
Test whether a type annotation code represents the type xs:ID or one of its subtypes |
boolean | isNilled(int nodeNr)
Determine whether a given node is nilled |
void | setConfiguration(Configuration config)
Set the Configuration that contains this document |
void | setElementAnnotation(int nodeNr, int typeCode)
Set the type annotation of an element node |
void | setLineNumber(int sequence, int line)
Set the line number for an element. |
void | setLineNumbering()
Set line numbering on |
void | setSystemId(int seq, String uri)
Set the system id of an element in the document. |
void | showSize() |
Parameters: parent the node number of the element nscode namespace code identifying the prefix and uri
Parameters: kind The kind of the node. This must be a document, element, text, comment, or processing-instruction node (not an attribute or namespace) depth The depth in the tree alpha Pointer to attributes or text beta Pointer to namespaces or text nameCode The name of the node
Returns: the node number of the node that was added
Returns: Type.UNTYPED_ATOMIC if there is no annotation
Parameters: nodeNr the node number
Returns: the name code
Parameters: nodeNr the node number
Returns: the node kind
Returns: the number of nodes.
Returns: -1 if the annotation is xdt:untyped or if the node is not an element.
Parameters: seq the node number uri the system ID