Package cdc.util.data

Class AbstractChild

  • All Implemented Interfaces:
    Child, Node
    Direct Known Subclasses:
    AbstractContentNode, Element

    abstract class AbstractChild
    extends Object
    implements Child
    Base class of nodes that are children (they have a parent node).
    Author:
    Damien Carbonne
    • Constructor Detail

      • AbstractChild

        protected AbstractChild()
    • Method Detail

      • clone

        public abstract AbstractChild clone​(boolean recurse)
        Description copied from interface: Node
        Return a clone of this node.
        Specified by:
        clone in interface Child
        Specified by:
        clone in interface Node
        Parameters:
        recurse - If true, also clone children nodes.
        Returns:
        A clone of this node, and optionally its children.
      • getDocument

        public final Document getDocument()
        Specified by:
        getDocument in interface Node
        Returns:
        The document of this node, possibly null.
      • getRootElement

        public final Element getRootElement()
        Description copied from interface: Node
        Returns the root element of this node.

        If this node is a document, then this is its unique child element, possibly null.
        If this node is a child, then this is the highest ancestor that is an element, possibly null.

        Specified by:
        getRootElement in interface Node
        Returns:
        The root element of this node, possibly null.
      • getParent

        public final Parent getParent()
        Specified by:
        getParent in interface Child
        Returns:
        The parent of this child. It may be null.
      • resetParent

        protected final void resetParent()
      • setParent

        public final void setParent​(Parent parent)
        Description copied from interface: Child
        Sets or changes the parent of this child.
        Specified by:
        setParent in interface Child
        Parameters:
        parent - The new parent. May be null.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object object)
        Overrides:
        equals in class Object