net.sf.saxon.tinytree

Class TinyTextImpl

public final class TinyTextImpl extends TinyNodeImpl

A node in the XML parse tree representing character content

Author: Michael H. Kay

Constructor Summary
TinyTextImpl(TinyTree tree, int nodeNr)
Create a text node
Method Summary
Valueatomize()
Get the typed value.
voidcopy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter
intgetNodeKind()
Return the type of node.
StringgetStringValue()
Return the character value of the node.
static CharSequencegetStringValue(TinyTree tree, int nodeNr)
Static method to get the string value of a text node without first constructing the node object
CharSequencegetStringValueCS()
Get the value of the item as a CharSequence.
SequenceIteratorgetTypedValue()
Get the typed value of this node.

Constructor Detail

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 Detail

atomize

public Value atomize()
Get the typed value. The result of this method will always be consistent with the method getTypedValue. However, this method is often more convenient and may be more efficient, especially in the common case where the value is expected to be a singleton.

Returns: the typed value. It will be a Value representing a sequence whose items are atomic values.

Since: 8.5

copy

public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter

getNodeKind

public final int getNodeKind()
Return the type of node.

Returns: Type.TEXT

getStringValue

public String getStringValue()
Return the character value of the node.

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.

getTypedValue

public SequenceIterator getTypedValue()
Get the typed value of this node. If there is no type annotation, we return the string value, as an instance of xs:untypedAtomic