Class CompositeNode<T extends INode>

    • Method Detail

      • isComposite

        public final boolean isComposite()

        Checks whether the node is composite. If true then the node can have child nodes.

        isComposite in class Node
      • getFirstChild

        public T getFirstChild()

        Gets the first child node of this node.

      • getLastChild

        public T getLastChild()

        Gets the last child node of this node.

      • getChildren

        public List<T> getChildren()

        Gets all child nodes of this node as an enumerable collection.

      • iterator

        public<T> iterator()

        Returns an enumerator that iterates through child nodes of the CompositeNode{T}.

        Specified by:
        iterator in interface<T extends INode>
        Specified by:
        iterator in interface<T extends INode>
        Specified by:
        iterator in interface Iterable<T extends INode>
        A T:IEnumerator`1 for the CompositeNode{T}.
      • appendChild

        public T appendChild(T newChild)

        Adds the node to the end of the list of child nodes for this node.

        newChild - The node to add.
        The added node.
      • removeChild

        public T removeChild(T oldChild)

        Removes the child node.

        oldChild - The node to remove.
        The removed node.
      • accept

        public void accept(DocumentVisitor visitor)

        Accepts the visitor of the node.

        Specified by:
        accept in interface INode
        Specified by:
        accept in class Node
        visitor - The object of a class derived from the DocumentVisitor.
      • getChildNodes

        public <T1 extends NodeList<T1> getChildNodes(Class<T1> typeParameterClass)

        Get all child nodes by the node type.

        Specified by:
        getChildNodes in interface ICompositeNode
        A list of child nodes.

        T1: The type of elements in the returned list.

      • getText

        public String getText()

        Get all text from the node.

        All text in the node.