net.sf.saxon.tinytree

Class TinyTextImpl

Implemented Interfaces:
ExtendedNodeInfo, FingerprintedNode, Item, NodeInfo, Source, PullEvent, Source, SourceLocator, ValueRepresentation

public final class TinyTextImpl
extends TinyNodeImpl

A node in the XML parse tree representing character content
Author:
Michael H. Kay

Field Summary

Fields inherited from class net.sf.saxon.tinytree.TinyNodeImpl

NODE_LETTER, nodeNr, parent, tree

Fields inherited from interface net.sf.saxon.om.NodeInfo

ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES

Fields inherited from interface net.sf.saxon.om.ValueRepresentation

EMPTY_VALUE_ARRAY

Constructor Summary

TinyTextImpl(TinyTree tree, int nodeNr)
Create a text node

Method Summary

void
copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter
int
getNodeKind()
Return the type of node.
String
getStringValue()
Return the character value of the node.
static CharSequence
getStringValue(TinyTree tree, int nodeNr)
Static method to get the string value of a text node without first constructing the node object
CharSequence
getStringValueCS()
Get the value of the item as a CharSequence.

Methods inherited from class net.sf.saxon.tinytree.TinyNodeImpl

atomize, compareOrder, equals, generateId, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNodeNumber, getParent, getPrefix, getPublicId, getRoot, getSequenceNumber, getStringValueCS, getSystemId, getTypeAnnotation, getTypedValue, getURI, hasChildNodes, hashCode, isAncestorOrSelf, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis, setParentNode, setSystemId

Constructor Details

TinyTextImpl

public TinyTextImpl(TinyTree tree,
                    int nodeNr)
Create a text node
Parameters:
tree - the tree to contain the node
nodeNr - the internal node number

Method Details

copy

public void copy(Receiver out,
                 int whichNamespaces,
                 boolean copyAnnotations,
                 int locationId)
            throws XPathException
Copy this node to a given outputter
Specified by:
copy in interface NodeInfo

getNodeKind

public final int getNodeKind()
Return the type of node.
Specified by:
getNodeKind in interface NodeInfo
Returns:
Type.TEXT

getStringValue

public String getStringValue()
Return the character value of the node.
Specified by:
getStringValue in interface NodeInfo
getStringValue in interface Item
getStringValue in interface ValueRepresentation
Returns:
the string value of the node

getStringValue

public static CharSequence getStringValue(TinyTree tree,
                                          int nodeNr)
Static method to get the string value of a text node without first constructing the node object
Parameters:
tree - the tree
nodeNr - the node number of the text node
Returns:
the string value of the text node

getStringValueCS

public CharSequence getStringValueCS()
Get the value of the item as a CharSequence. This is in some cases more efficient than the version of the method that returns a String.
Specified by:
getStringValueCS in interface Item
getStringValueCS in interface ValueRepresentation
Overrides:
getStringValueCS in interface TinyNodeImpl