| java.lang.Object net.sf.saxon.tinytree.TinyTree
TinyTree | final public class TinyTree (Code) | | 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.
|
Constructor Summary | |
public | TinyTree() | public | TinyTree(int nodes, int attributes, int namespaces, int characters) |
Method Summary | |
void | addAttribute(NodeInfo root, int parent, int nameCode, int typeCode, CharSequence attValue, int properties) | void | addDocumentNode(TinyDocumentImpl doc) Add a document node to the tree. | void | addNamespace(int parent, int nscode) | int | addNode(short kind, int depth, int alpha, int beta, int nameCode) Add a node to the tree
Parameters: kind - The kind of the node. | void | appendChars(CharSequence chars) | protected void | condense() Condense the tree: release unused memory. | public void | diagnosticDump() | void | ensurePriorIndex() | public int[] | getAlphaArray() | int | getAttributeAnnotation(int nr) Get the type annotation of an attribute node. | public int[] | getAttributeNameCodeArray() | TinyAttributeImpl | getAttributeNode(int nr) | public int[] | getAttributeParentArray() | public int[] | getAttributeTypeCodeArray() | public CharSequence[] | getAttributeValueArray() | public int[] | getBetaArray() | public CharSequence | getCharacterBuffer() | public CharSequence | getCommentBuffer() | public Configuration | getConfiguration() | public int | getDocumentNumber() | int | getLineNumber(int sequence) Get the line number for an element. | public int | getNameCode(int nodeNr) | public int[] | getNameCodeArray() | public NamePool | getNamePool() | public int[] | getNamespaceCodeArray() | public int[] | getNamespaceParentArray() | public int[] | getNextPointerArray() | public TinyNodeImpl | getNode(int nr) | public short[] | getNodeDepthArray() | public int | getNodeKind(int nodeNr) | public byte[] | getNodeKindArray() | public int | getNumberOfAttributes() | public int | getNumberOfNamespaces() | public int | getNumberOfNodes() | int | getRootNode(int nodeNr) | String | getSystemId(int seq) | public int | getTypeAnnotation(int nodeNr) Get the type annotation of a node. | public int[] | getTypeCodeArray() | UntypedAtomicValue | getUntypedAtomicValue(int nodeNr) Get the typed value of a node whose type is known to be untypedAtomic. | public void | indexIDElement(NodeInfo root, int nodeNr, NameChecker checker) | public boolean | isIDCode(int typeCode) | boolean | isIdref(int nr) Determine whether an attribute is an IDREF/IDREFS attribute. | public boolean | isNilled(int nodeNr) | public void | setConfiguration(Configuration config) | void | setElementAnnotation(int nodeNr, int typeCode) | void | setLineNumber(int sequence, int line) Set the line number for an element. | public void | setLineNumbering() | void | setSystemId(int seq, String uri) Set the system id of an element in the document. | public void | showSize() |
alpha | protected int[] alpha(Code) | | |
attCode | protected int[] attCode(Code) | | |
attParent | protected int[] attParent(Code) | | |
attTypeCode | protected int[] attTypeCode(Code) | | |
beta | protected int[] beta(Code) | | |
charBuffer | protected char[] charBuffer(Code) | | |
charBufferLength | protected int charBufferLength(Code) | | |
depth | protected short[] depth(Code) | | |
documentNumber | protected int documentNumber(Code) | | |
nameCode | protected int[] nameCode(Code) | | |
namespaceCode | protected int[] namespaceCode(Code) | | |
namespaceParent | protected int[] namespaceParent(Code) | | |
next | protected int[] next(Code) | | |
nodeKind | public byte[] nodeKind(Code) | | |
numberOfAttributes | protected int numberOfAttributes(Code) | | |
numberOfNamespaces | protected int numberOfNamespaces(Code) | | |
numberOfNodes | protected int numberOfNodes(Code) | | |
prior | protected int[] prior(Code) | | |
typeCodeArray | protected int[] typeCodeArray(Code) | | |
usesNamespaces | protected boolean usesNamespaces(Code) | | |
TinyTree | public TinyTree()(Code) | | |
TinyTree | public TinyTree(int nodes, int attributes, int namespaces, int characters)(Code) | | |
addAttribute | void addAttribute(NodeInfo root, int parent, int nameCode, int typeCode, CharSequence attValue, int properties)(Code) | | |
addDocumentNode | void addDocumentNode(TinyDocumentImpl doc)(Code) | | Add a document node to the tree. The data structure can contain any number of document (or element) nodes
as top-level nodes. The document node is retained in the documentList list, and its offset in that list
is held in the alpha array for the relevant node number.
|
addNamespace | void addNamespace(int parent, int nscode)(Code) | | Add a namespace node to the current element
Parameters: parent - the node number of the element Parameters: nscode - namespace code identifying the prefix and uri |
addNode | int addNode(short kind, int depth, int alpha, int beta, int nameCode)(Code) | | Add a node to the tree
Parameters: kind - The kind of the node. This must be a document, element, text, comment,or processing-instruction node (not an attribute or namespace) Parameters: depth - The depth in the tree Parameters: alpha - Pointer to attributes or text Parameters: beta - Pointer to namespaces or text Parameters: nameCode - The name of the node the node number of the node that was added |
condense | protected void condense()(Code) | | Condense the tree: release unused memory. This is done after the full tree has been built.
The method makes a pragmatic judgement as to whether it is worth reclaiming space; this is
only done when the constructed tree is very small compared with the space allocated.
|
diagnosticDump | public void diagnosticDump()(Code) | | Produce diagnostic print of main tree arrays
|
ensurePriorIndex | void ensurePriorIndex()(Code) | | On demand, make an index for quick access to preceding-sibling nodes
|
getAlphaArray | public int[] getAlphaArray()(Code) | | |
getAttributeAnnotation | int getAttributeAnnotation(int nr)(Code) | | Get the type annotation of an attribute node.
The bit
NodeInfo.IS_DTD_TYPE (1<<30) will be set in the case of an attribute node if the type annotation
is one of ID, IDREF, or IDREFS and this is derived from DTD rather than schema validation.
Type.UNTYPED_ATOMIC if there is no annotation |
getAttributeNameCodeArray | public int[] getAttributeNameCodeArray()(Code) | | |
getAttributeNode | TinyAttributeImpl getAttributeNode(int nr)(Code) | | Make a (transient) attribute node from the array of attributes
|
getAttributeParentArray | public int[] getAttributeParentArray()(Code) | | |
getAttributeTypeCodeArray | public int[] getAttributeTypeCodeArray()(Code) | | |
getBetaArray | public int[] getBetaArray()(Code) | | |
getConfiguration | public Configuration getConfiguration()(Code) | | Get the configuration previously set using setConfiguration
|
getDocumentNumber | public int getDocumentNumber()(Code) | | Get the document number (actually, the tree number)
|
getLineNumber | int getLineNumber(int sequence)(Code) | | Get the line number for an element. Return -1 if line numbering is off.
|
getNameCode | public int getNameCode(int nodeNr)(Code) | | Get the nameCode for a given node, which must be a document, element,
text, comment, or processing instruction node
Parameters: nodeNr - the node number the name code |
getNameCodeArray | public int[] getNameCodeArray()(Code) | | |
getNamePool | public NamePool getNamePool()(Code) | | Get the name pool used for the names in this document
|
getNamespaceCodeArray | public int[] getNamespaceCodeArray()(Code) | | |
getNamespaceParentArray | public int[] getNamespaceParentArray()(Code) | | |
getNextPointerArray | public int[] getNextPointerArray()(Code) | | |
getNodeDepthArray | public short[] getNodeDepthArray()(Code) | | |
getNodeKind | public int getNodeKind(int nodeNr)(Code) | | Get the node kind of a given node, which must be a document, element,
text, comment, or processing instruction node
Parameters: nodeNr - the node number the node kind |
getNodeKindArray | public byte[] getNodeKindArray()(Code) | | |
getNumberOfAttributes | public int getNumberOfAttributes()(Code) | | |
getNumberOfNamespaces | public int getNumberOfNamespaces()(Code) | | |
getNumberOfNodes | public int getNumberOfNodes()(Code) | | Get the number of nodes in the tree, excluding attributes and namespace nodes
the number of nodes. |
getRootNode | int getRootNode(int nodeNr)(Code) | | Get the root node for a given node
|
getSystemId | String getSystemId(int seq)(Code) | | Get the system id of an element in the document
|
getTypeAnnotation | public int getTypeAnnotation(int nodeNr)(Code) | | Get the type annotation of a node. Applies only to document, element, text,
processing instruction, and comment nodes.
-1 if the annotation is xdt:untyped or if the node is not an element. |
getTypeCodeArray | public int[] getTypeCodeArray()(Code) | | |
getUntypedAtomicValue | UntypedAtomicValue getUntypedAtomicValue(int nodeNr)(Code) | | Get the typed value of a node whose type is known to be untypedAtomic.
The node must be a document, element, text,
comment, or processing-instruction node, and it must have no type annotation.
This method gets the typed value
of a numbered node without actually instantiating the NodeInfo object, as
a performance optimization.
|
indexIDElement | public void indexIDElement(NodeInfo root, int nodeNr, NameChecker checker)(Code) | | Index an element of type xs:ID
|
isIDCode | public boolean isIDCode(int typeCode)(Code) | | Test whether a type annotation code represents the type xs:ID or one of its subtypes
|
isIdref | boolean isIdref(int nr)(Code) | | Determine whether an attribute is an IDREF/IDREFS attribute. (The represents the
is-IDREF property in the data model
|
isNilled | public boolean isNilled(int nodeNr)(Code) | | Determine whether a given node is nilled
|
setConfiguration | public void setConfiguration(Configuration config)(Code) | | Set the Configuration that contains this document
|
setElementAnnotation | void setElementAnnotation(int nodeNr, int typeCode)(Code) | | Set the type annotation of an element node
|
setLineNumber | void setLineNumber(int sequence, int line)(Code) | | Set the line number for an element. Ignored if line numbering is off.
|
setLineNumbering | public void setLineNumbering()(Code) | | Set line numbering on
|
setSystemId | void setSystemId(int seq, String uri)(Code) | | Set the system id of an element in the document. This identifies the external entity containing
the node - this is not necessarily the same as the base URI.
Parameters: seq - the node number Parameters: uri - the system ID |
showSize | public void showSize()(Code) | | |
|
|