org.apache.xerces.dom

Class ChildNode

Implemented Interfaces:
Cloneable, EventTarget, Node, NodeList, Serializable
Known Direct Subclasses:
CharacterDataImpl, ParentNode

public abstract class ChildNode
extends NodeImpl

ChildNode inherits from NodeImpl and adds the capability of being a child by having references to its previous and next siblings.
Version:
$Id: ChildNode.java,v 1.10 2004/10/05 17:12:51 mrglavas Exp $

Field Summary

protected ChildNode
nextSibling
Next sibling.
protected ChildNode
previousSibling
Previous sibling.

Fields inherited from class org.apache.xerces.dom.NodeImpl

DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, flags, ownerNode

Constructor Summary

ChildNode()
Constructor for serialization.
ChildNode(CoreDocumentImpl ownerDocument)
No public constructor; only subclasses of Node should be instantiated, and those normally via a Document's factory methods

Every Node knows what Document it belongs to.

Method Summary

Node
cloneNode(boolean deep)
Returns a duplicate of a given node.
Node
getNextSibling()
The next child of this node's parent, or null if none
Node
getParentNode()
Returns the parent node of this node
Node
getPreviousSibling()
The previous child of this node's parent, or null if none

Methods inherited from class org.apache.xerces.dom.NodeImpl

addEventListener, appendChild, changed, changes, cloneNode, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getContainer, getFeature, getFirstChild, getLastChild, getLength, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeNumber, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getReadOnly, getTextContent, getUserData, getUserData, getUserDataRecord, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, needsSyncChildren, normalize, removeChild, removeEventListener, replaceChild, setNodeValue, setPrefix, setReadOnly, setTextContent, setUserData, setUserData, synchronizeData, toString

Field Details

nextSibling

protected ChildNode nextSibling
Next sibling.

previousSibling

protected ChildNode previousSibling
Previous sibling.

Constructor Details

ChildNode

public ChildNode()
Constructor for serialization.

ChildNode

protected ChildNode(CoreDocumentImpl ownerDocument)
No public constructor; only subclasses of Node should be instantiated, and those normally via a Document's factory methods

Every Node knows what Document it belongs to.

Method Details

cloneNode

public Node cloneNode(boolean deep)
Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other.

Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior.

Overrides:
cloneNode in interface NodeImpl

getNextSibling

public Node getNextSibling()
The next child of this node's parent, or null if none
Overrides:
getNextSibling in interface NodeImpl

getParentNode

public Node getParentNode()
Returns the parent node of this node
Overrides:
getParentNode in interface NodeImpl

getPreviousSibling

public Node getPreviousSibling()
The previous child of this node's parent, or null if none
Overrides:
getPreviousSibling in interface NodeImpl

Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.