org.apache.xerces.dom

Class ChildNode

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.

INTERNAL:

Usage of this class is not supported. It may be altered or removed at any time.

Version: $Id: ChildNode.java,v 1.10 2004/10/05 17:12:51 mrglavas Exp $

Field Summary
protected ChildNodenextSibling
Next sibling.
protected ChildNodepreviousSibling
Previous sibling.
Constructor Summary
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.

ChildNode()
Constructor for serialization.
Method Summary
NodecloneNode(boolean deep)
Returns a duplicate of a given node.
NodegetNextSibling()
The next child of this node's parent, or null if none
NodegetParentNode()
Returns the parent node of this node
NodegetPreviousSibling()
The previous child of this node's parent, or null if none

Field Detail

nextSibling

protected ChildNode nextSibling
Next sibling.

previousSibling

protected ChildNode previousSibling
Previous sibling.

Constructor Detail

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.

ChildNode

public ChildNode()
Constructor for serialization.

Method Detail

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.

See Also:

Example: Cloning a Text node will copy both the node and the text it contains.

Example: Cloning something that has children -- Element or Attr, for example -- will _not_ clone those children unless a "deep clone" has been requested. A shallow clone of an Attr node will yield an empty Attr of the same name.

NOTE: Clones will always be read/write, even if the node being cloned is read-only, to permit applications using only the DOM API to obtain editable copies of locked portions of the tree.

getNextSibling

public Node getNextSibling()
The next child of this node's parent, or null if none

getParentNode

public Node getParentNode()
Returns the parent node of this node

getPreviousSibling

public Node getPreviousSibling()
The previous child of this node's parent, or null if none
Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.