net.sf.saxon.tinytree
Class TinyTree

java.lang.Object
  extended bynet.sf.saxon.tinytree.TinyTree

public final class TinyTree
extends java.lang.Object

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  char[] charBuffer
           
protected  int charBufferLength
           
protected  FastStringBuffer commentBuffer
           
protected  short[] depth
           
protected  int documentNumber
           
protected  int[] nameCode
           
protected  int[] namespaceCode
           
protected  int[] namespaceParent
           
protected  int[] next
           
protected  byte[] nodeKind
           
protected  int numberOfAttributes
           
protected  int numberOfNamespaces
           
protected  int numberOfNodes
           
protected  int[] prior
           
protected  int[] typeCodeArray
           
 
Constructor Summary
TinyTree()
           
TinyTree(int nodes, int attributes, int namespaces, int characters)
           
 
Method Summary
 void condense()
          Condense the tree: release unused memory.
 void diagnosticDump()
          Produce diagnostic print of main tree arrays
 Configuration getConfiguration()
          Get the configuration previously set using setConfiguration
 int getDocumentNumber()
          Get the document number (actually, the tree number)
 NamePool getNamePool()
          Get the name pool used for the names in this document
 TinyNodeImpl getNode(int nr)
           
 int getNumberOfNodes()
          Get the number of nodes in the tree, excluding attributes and namespace nodes
 void setConfiguration(Configuration config)
          Set the Configuration that contains this document
 void setLineNumbering()
          Set line numbering on
 void showSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

documentNumber

protected int documentNumber

charBuffer

protected char[] charBuffer

charBufferLength

protected int charBufferLength

commentBuffer

protected FastStringBuffer commentBuffer

numberOfNodes

protected int numberOfNodes

nodeKind

protected byte[] nodeKind

depth

protected short[] depth

next

protected int[] next

alpha

protected int[] alpha

beta

protected int[] beta

nameCode

protected int[] nameCode

prior

protected int[] prior

typeCodeArray

protected int[] typeCodeArray

numberOfAttributes

protected int numberOfAttributes

attParent

protected int[] attParent

attCode

protected int[] attCode

attValue

protected java.lang.CharSequence[] attValue

attTypeCode

protected int[] attTypeCode

numberOfNamespaces

protected int numberOfNamespaces

namespaceParent

protected int[] namespaceParent

namespaceCode

protected int[] namespaceCode
Constructor Detail

TinyTree

public TinyTree()

TinyTree

public TinyTree(int nodes,
                int attributes,
                int namespaces,
                int characters)
Method Detail

setConfiguration

public void setConfiguration(Configuration config)
Set the Configuration that contains this document


getConfiguration

public Configuration getConfiguration()
Get the configuration previously set using setConfiguration


getNamePool

public NamePool getNamePool()
Get the name pool used for the names in this document


condense

public void condense()
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.


getNode

public TinyNodeImpl getNode(int nr)

setLineNumbering

public void setLineNumbering()
Set line numbering on


getDocumentNumber

public int getDocumentNumber()
Get the document number (actually, the tree number)


diagnosticDump

public void diagnosticDump()
Produce diagnostic print of main tree arrays


showSize

public void showSize()

getNumberOfNodes

public int getNumberOfNodes()
Get the number of nodes in the tree, excluding attributes and namespace nodes

Returns:
the number of nodes.