com.aspose.note

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.

        Overrides:
        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 com.aspose.ms.System.Collections.Generic.IGenericEnumerator<T> iterator()

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

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T extends INode>
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<T extends INode>
        Specified by:
        iterator in interface Iterable<T extends INode>
        Returns:
        A T:IEnumerator`1 for the CompositeNode{T}.
      • insertChild

        public T insertChild(int i,
                             T newChild)

        Inserts the node to the specified position in the list of child nodes for this node.

        Parameters:
        i - Position to insert
        newChild - The node to insert.
        Returns:
        The added node.
      • insertChildrenRange

        public final void insertChildrenRange(int i,
                                              Iterable<T> newChildren)

        Inserts the node's sequence starting from specified position in the list of child nodes for this node.

        Parameters:
        i - Position to insert
        newChildren - The sequence of nodes to be inserted.
      • insertChildrenRange

        public final void insertChildrenRange(int i,
                                              T... newChildren)

        Inserts the node's sequence starting from specified position in the list of child nodes for this node.

        Parameters:
        i - Position to insert
        newChildren - The sequence of nodes to be inserted.
      • appendChildFirst

        public T appendChildFirst(T newChild)

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

        Parameters:
        newChild - The node to add.
        Returns:
        The added node.
      • appendChildLast

        public T appendChildLast(T newChild)

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

        Parameters:
        newChild - The node to add.
        Returns:
        The added node.
      • appendChild

        @Deprecated
        public T appendChild(T newChild)
        Deprecated. 

        Adds the node to the end of the list of child nodes for this node. Deprecated since 18.9 version. Use AppendChildFirst/AppendChildLast/InsertChild/InsertChildrenRange instead of this one.

        Parameters:
        newChild - The node to add.
        Returns:
        The added node.
      • removeChild

        public T removeChild(T oldChild)

        Removes the child node.

        Parameters:
        oldChild - The node to remove.
        Returns:
        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
        Parameters:
        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
        Returns:
        A list of child nodes.

        T1: The type of elements in the returned list.

      • getText

        public String getText()

        Get all text from the node.

        Returns:
        All text in the node.