net.sf.saxon.tinytree
Class TinyBuilderCondensed

java.lang.Object
  extended by net.sf.saxon.event.Builder
      extended by net.sf.saxon.tinytree.TinyBuilder
          extended by net.sf.saxon.tinytree.TinyBuilderCondensed
All Implemented Interfaces:
Result, Receiver

public class TinyBuilderCondensed
extends TinyBuilder

Variant of the TinyBuilder to create a tiny tree in which multiple text nodes or attribute nodes sharing the same string value economize on space by only holding the value once.


Field Summary
 IntHashMap<int[]> textValues
           
 
Fields inherited from class net.sf.saxon.tinytree.TinyBuilder
PARENT_POINTER_INTERVAL
 
Fields inherited from class net.sf.saxon.event.Builder
baseURI, config, currentRoot, lineNumbering, LINKED_TREE, namePool, pipe, STANDARD_TREE, started, systemId, timing, TINY_TREE, TINY_TREE_CONDENSED, UNSPECIFIED_TREE_MODEL
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
TinyBuilderCondensed()
           
 
Method Summary
 void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
          For attribute nodes, the commoning-up of stored values is achieved simply by calling intern() on the string value of the attribute.
protected  int makeTextNode(CharSequence chars, int len)
          Create a text node.
 
Methods inherited from class net.sf.saxon.tinytree.TinyBuilder
characters, close, comment, endDocument, endElement, getCurrentDepth, getLastCompletedElement, getSizeParameters, getTree, namespace, open, processingInstruction, reset, setSizeParameters, setUnparsedEntity, startContent, startDocument, startElement
 
Methods inherited from class net.sf.saxon.event.Builder
build, build, getBaseURI, getConfiguration, getCurrentRoot, getPipelineConfiguration, getSystemId, isTiming, setBaseURI, setLineNumbering, setPipelineConfiguration, setSystemId, setTiming, usesTypeAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textValues

public IntHashMap<int[]> textValues
Constructor Detail

TinyBuilderCondensed

public TinyBuilderCondensed()
Method Detail

makeTextNode

protected int makeTextNode(CharSequence chars,
                           int len)
Create a text node. Separate method so it can be overridden

Overrides:
makeTextNode in class TinyBuilder
Parameters:
chars - the contents of the text node
len - the length of the text node

attribute

public void attribute(int nameCode,
                      int typeCode,
                      CharSequence value,
                      int locationId,
                      int properties)
               throws XPathException
For attribute nodes, the commoning-up of stored values is achieved simply by calling intern() on the string value of the attribute.

Specified by:
attribute in interface Receiver
Overrides:
attribute in class TinyBuilder
Parameters:
nameCode - The name of the attribute, as held in the name pool
typeCode - The type of the attribute, as held in the name pool. The additional bit NodeInfo.IS_DTD_TYPE may be set to indicate a DTD-derived type.
value - the string value of the attribute
locationId - an integer which can be interpreted using a LocationProvider to return information such as line number and system ID. If no location information is available, the value zero is supplied.
properties - Bit significant value. The following bits are defined:
DISABLE_ESCAPING
Disable escaping for this attribute
NO_SPECIAL_CHARACTERS
Attribute value contains no special characters
Throws:
XPathException


Copyright (c) Saxonica Limited. All rights reserved.