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.

Methods

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

isComposite()

public final boolean isComposite()

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

Returns: boolean

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

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 - A T:IEnumerator1 for the CompositeNode{T} .

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.

insertChildrenRange(int i, Iterable 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.IterableThe sequence of nodes to be inserted.

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.

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.

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.

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 .

getChildNodes(Class typeParameterClass)

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

Get all child nodes by the node type.

Parameters:

ParameterTypeDescription
typeParameterClassjava.lang.Class

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

T1 : The type of elements in the returned list.