org.cdlib.xtf.lazyTree
Class ParentNodeImpl

Object
  extended by NodeImpl
      extended by ParentNodeImpl
All Implemented Interfaces:
Source, SourceLocator, FingerprintedNode, Item, NodeInfo, ValueRepresentation
Direct Known Subclasses:
ElementImpl, LazyDocument

public abstract class ParentNodeImpl
extends NodeImpl

Represents any node that can have children. Important note: when comparing for a Saxon upgrade, this code is kind of a mix between net.sf.saxon.tinytree.TinyParentNodeImpl and net.sf.saxon.tree.ParentNodeImpl.


Field Summary
(package private)  int childNum
           
 
Fields inherited from class NodeImpl
document, nameCode, nextSibNum, NODE_LETTER, nodeNum, parentNum, prevSibNum
 
Fields inherited from interface NodeInfo
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
 
Fields inherited from interface ValueRepresentation
EMPTY_VALUE_ARRAY
 
Constructor Summary
ParentNodeImpl()
           
 
Method Summary
 AxisIterator enumerateChildren(NodeTest test)
           
 NodeInfo getFirstChild()
          Get first child (DOM method)
 NodeInfo getLastChild()
          The last child of this Node, or null if none.
 String getStringValue()
          Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.
 CharSequence getStringValueCS()
          Get the value of the item as a CharSequence.
 boolean hasChildNodes()
          Determine whether the node has any children.
 AxisIterator iterateAxis(byte axisNumber)
          Return an enumeration over the nodes reached by the given axis from this node
 AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest)
          Return an enumeration over the nodes reached by the given axis from this node
 
Methods inherited from class NodeImpl
atomize, compareOrder, equals, generateId, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getRoot, getSequenceNumber, getSystemId, getTypeAnnotation, getTypedValue, getURI, hashCode, init, isSameNodeInfo, sendNamespaceDeclarations, setSystemId
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface NodeInfo
copy, getNodeKind
 

Field Detail

childNum

int childNum
Constructor Detail

ParentNodeImpl

public ParentNodeImpl()
Method Detail

hasChildNodes

public final boolean hasChildNodes()
Description copied from class: NodeImpl
Determine whether the node has any children.

Specified by:
hasChildNodes in interface NodeInfo
Overrides:
hasChildNodes in class NodeImpl
Returns:
true if the node has any children, false if the node has no children.

enumerateChildren

public final AxisIterator enumerateChildren(NodeTest test)

iterateAxis

public AxisIterator iterateAxis(byte axisNumber)
Description copied from class: NodeImpl
Return an enumeration over the nodes reached by the given axis from this node

Specified by:
iterateAxis in interface NodeInfo
Overrides:
iterateAxis in class NodeImpl
Parameters:
axisNumber - The axis to be iterated over
Returns:
an AxisIterator that scans the nodes reached by the axis in turn.

iterateAxis

public AxisIterator iterateAxis(byte axisNumber,
                                NodeTest nodeTest)
Description copied from class: NodeImpl
Return an enumeration over the nodes reached by the given axis from this node

Specified by:
iterateAxis in interface NodeInfo
Overrides:
iterateAxis in class NodeImpl
Parameters:
axisNumber - The axis to be iterated over
nodeTest - A pattern to be matched by the returned nodes
Returns:
an AxisIterator that scans the nodes reached by the axis in turn.

getFirstChild

public NodeInfo getFirstChild()
Get first child (DOM method)

Overrides:
getFirstChild in class NodeImpl
Returns:
the first child node of this node, or null if it has no children

getLastChild

public NodeInfo getLastChild()
The last child of this Node, or null if none.

Overrides:
getLastChild in class NodeImpl
Returns:
null

getStringValue

public String getStringValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.

Returns:
the accumulated character content of the element, including descendant elements.

getStringValueCS

public CharSequence getStringValueCS()
Description copied from class: NodeImpl
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
Specified by:
getStringValueCS in interface ValueRepresentation
Overrides:
getStringValueCS in class NodeImpl