|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.tinytree.TinyTree
public final class TinyTree
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.
Field Summary | |
---|---|
protected int[] |
alpha
|
protected int[] |
attCode
|
protected int[] |
attParent
|
protected int[] |
attTypeCode
|
protected java.lang.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 | |
---|---|
(package private) void |
addAttribute(NodeInfo root,
int parent,
int nameCode,
int typeCode,
java.lang.CharSequence attValue)
|
(package private) void |
addDocumentNode(TinyDocumentImpl doc)
Add a document node to the tree. |
(package private) void |
addNamespace(int parent,
int nscode)
Add a namespace node to the current element |
(package private) int |
addNode(short kind,
int depth,
int alpha,
int beta,
int nameCode)
Add a node to the tree |
(package private) void |
appendChars(java.lang.CharSequence chars)
|
protected void |
condense()
Condense the tree: release unused memory. |
void |
diagnosticDump()
Produce diagnostic print of main tree arrays |
(package private) void |
ensurePriorIndex()
On demand, make an index for quick access to preceding-sibling nodes |
int[] |
getAlphaArray()
|
(package private) int |
getAttributeAnnotation(int nr)
Get the type annotation of an attribute node. |
int[] |
getAttributeNameCodeArray()
|
(package private) TinyAttributeImpl |
getAttributeNode(int nr)
Make a (transient) attribute node from the array of attributes |
int[] |
getAttributeParentArray()
|
int[] |
getAttributeTypeCodeArray()
|
java.lang.CharSequence[] |
getAttributeValueArray()
|
int[] |
getBetaArray()
|
java.lang.CharSequence |
getCharacterBuffer()
|
java.lang.CharSequence |
getCommentBuffer()
|
Configuration |
getConfiguration()
Get the configuration previously set using setConfiguration |
int |
getDocumentNumber()
Get the document number (actually, the tree number) |
(package private) 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 |
(package private) int |
getRootNode(int nodeNr)
Get the root node for a given node |
(package private) java.lang.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()
|
(package private) 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 |
isIDCode(int typeCode)
Test whether a type annotation code represents the type xs:ID or one of its subtypes |
(package private) boolean |
isIdref(int nr)
Determine whether an attribute is an IDREF/IDREFS attribute. |
boolean |
isNilled(int nodeNr)
Determine whether a given node is nilled |
void |
setConfiguration(Configuration config)
Set the Configuration that contains this document |
(package private) void |
setElementAnnotation(int nodeNr,
int typeCode)
Set the type annotation of an element node |
(package private) void |
setLineNumber(int sequence,
int line)
Set the line number for an element. |
void |
setLineNumbering()
Set line numbering on |
(package private) void |
setSystemId(int seq,
java.lang.String uri)
Set the system id of an element in the document. |
void |
showSize()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int documentNumber
protected LargeStringBuffer 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 int numberOfAttributes
protected int[] attParent
protected int[] attCode
protected java.lang.CharSequence[] attValue
protected int[] attTypeCode
protected int numberOfNamespaces
protected int[] namespaceParent
protected int[] namespaceCode
protected boolean usesNamespaces
Constructor Detail |
---|
public TinyTree()
public TinyTree(int nodes, int attributes, int namespaces, int characters)
Method Detail |
---|
public void setConfiguration(Configuration config)
public Configuration getConfiguration()
public NamePool getNamePool()
void addDocumentNode(TinyDocumentImpl doc)
int addNode(short kind, int depth, int alpha, int beta, int nameCode)
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 treealpha
- Pointer to attributes or textbeta
- Pointer to namespaces or textnameCode
- The name of the node
void appendChars(java.lang.CharSequence chars)
protected void condense()
void setElementAnnotation(int nodeNr, int typeCode)
public int getTypeAnnotation(int nodeNr)
public int getNodeKind(int nodeNr)
nodeNr
- the node number
public int getNameCode(int nodeNr)
nodeNr
- the node number
void ensurePriorIndex()
void addAttribute(NodeInfo root, int parent, int nameCode, int typeCode, java.lang.CharSequence attValue)
public void indexIDElement(NodeInfo root, int nodeNr, NameChecker checker)
public boolean isIDCode(int typeCode)
void addNamespace(int parent, int nscode)
parent
- the node number of the elementnscode
- namespace code identifying the prefix and uripublic TinyNodeImpl getNode(int nr)
UntypedAtomicValue getUntypedAtomicValue(int nodeNr)
TinyAttributeImpl getAttributeNode(int nr)
int getAttributeAnnotation(int nr)
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.
boolean isIdref(int nr)
void setSystemId(int seq, java.lang.String uri)
seq
- the node numberuri
- the system IDjava.lang.String getSystemId(int seq)
int getRootNode(int nodeNr)
public void setLineNumbering()
void setLineNumber(int sequence, int line)
int getLineNumber(int sequence)
public int getDocumentNumber()
public boolean isNilled(int nodeNr)
public void diagnosticDump()
public 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 java.lang.CharSequence getCharacterBuffer()
public java.lang.CharSequence getCommentBuffer()
public int[] getAttributeNameCodeArray()
public int[] getAttributeTypeCodeArray()
public int[] getAttributeParentArray()
public java.lang.CharSequence[] getAttributeValueArray()
public int[] getNamespaceCodeArray()
public int[] getNamespaceParentArray()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |