CompositeNode

Inheritance: java.lang.Object, com.aspose.note.Node, com.aspose.note.CompositeNodeBase

All Implemented Interfaces: com.aspose.note.ICompositeNodeT

public abstract class CompositeNode<T> extends CompositeNodeBase implements ICompositeNodeT<T>

The base generic class for nodes that can contain other nodes.

T: The type of elements in the composite node.

T :

Methods

MethodDescription
<T1>appendChildFirst(T1 newChild)Adds the node to the front of the list of child nodes for this node.
<T1>appendChildLast(T1 newChild)Adds the node to the end of the list of child nodes for this node.
<T1>getChildNodes(Class<T1> typeParameterClass)Get all child nodes by the node type.
<T1>insertChild(int i, T1 newChild)Inserts the node to the specified position in the list of child nodes for this node.
<T1>removeChild(T1 oldChild)Removes the child node.
accept(DocumentVisitor visitor)Accepts the visitor of the node.
getFirstChild()Gets the first child node of this node.
getLastChild()Gets the last child node of this node.
insertChildrenRange(int i, T[] newChildren)Inserts the node’s sequence starting from specified position in the list of child nodes for this node.
insertChildrenRange(int i, Iterable<T> newChildren)Inserts the node’s sequence starting from specified position in the list of child nodes for this node.
isComposite()Checks whether the node is composite.
iterator()Returns an enumerator that iterates through child nodes of the CompositeNode\{T\}.

<T1>appendChildFirst(T1 newChild)

public T1 <T1>appendChildFirst(T1 newChild)

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

Parameters:

ParameterTypeDescription
newChildT1The node to add.

Returns: T1 - The added node.

<T1>appendChildLast(T1 newChild)

public T1 <T1>appendChildLast(T1 newChild)

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

Parameters:

ParameterTypeDescription
newChildT1The node to add.

Returns: T1 - The added node.

<T1>getChildNodes(Class<T1> typeParameterClass)

public List<T1> <T1>getChildNodes(Class<T1> typeParameterClass)

Get all child nodes by the node type.

Parameters:

ParameterTypeDescription
typeParameterClassjava.lang.Class<T1>

Returns: java.util.List<T1> - A list of child nodes.

T1: The type of elements in the returned list.

<T1>insertChild(int i, T1 newChild)

public T1 <T1>insertChild(int i, T1 newChild)

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

Parameters:

ParameterTypeDescription
iintPosition to insert
newChildT1The node to insert.

Returns: T1 - The added node.

<T1>removeChild(T1 oldChild)

public T1 <T1>removeChild(T1 oldChild)

Removes the child node.

Parameters:

ParameterTypeDescription
oldChildT1The node to remove.

Returns: T1 - The removed node.

accept(DocumentVisitor visitor)

public void accept(DocumentVisitor visitor)

Accepts the visitor of the node.

Parameters:

ParameterTypeDescription
visitorDocumentVisitorThe object of a class derived from the DocumentVisitor.

getFirstChild()

public T getFirstChild()

Gets the first child node of this node.

Returns: T

getLastChild()

public T getLastChild()

Gets the last child node of this node.

Returns: T

insertChildrenRange(int i, T[] newChildren)

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:

ParameterTypeDescription
iintPosition to insert
newChildrenT[]The sequence of nodes to be inserted.

insertChildrenRange(int i, Iterable<T> newChildren)

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:

ParameterTypeDescription
iintPosition to insert
newChildrenjava.lang.Iterable<T>The sequence of nodes to be inserted.

isComposite()

public final boolean isComposite()

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

Returns: boolean

iterator()

public System.Collections.Generic.IGenericEnumerator<T> iterator()

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

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<T> - A T:IEnumerator1for theCompositeNode{T}`.