public abstract class CompositeNode<T extends INode> extends CompositeNodeBase implements com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T>
The base generic class for nodes that can contain other nodes.
T:
The type of elements in the composite node.
| Modifier and Type | Method and Description |
|---|---|
void |
accept(DocumentVisitor visitor)
Accepts the visitor of the node.
|
<T1 extends T> |
appendChildFirst(T1 newChild)
Adds the node to the front of the list of child nodes for this node.
|
<T1 extends T> |
appendChildLast(T1 newChild)
Adds the node to the end of the list of child nodes for this node.
|
<T1 extends INode> |
getChildNodes(Class<T1> typeParameterClass)
Get all child nodes by the node type.
|
List<T> |
getChildren()
Gets all child nodes of this node as an enumerable collection.
|
T |
getFirstChild()
Gets the first child node of this node.
|
T |
getLastChild()
Gets the last child node of this node.
|
<T1 extends T> |
insertChild(int i,
T1 newChild)
Inserts the node to the specified position in the list of child nodes for this node.
|
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.
|
void |
insertChildrenRange(int i,
T... newChildren)
Inserts the node's sequence starting from specified position in the list of child nodes for this node.
|
boolean |
isComposite()
Checks whether the node is composite.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<T> |
iterator()
Returns an enumerator that iterates through child nodes of the
CompositeNode{T}. |
<T1 extends T> |
removeChild(T1 oldChild)
Removes the child node.
|
getDocument, getNextSibling, getNodeType, getParentNode, getPreviousSiblingequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic final boolean isComposite()
Checks whether the node is composite. If true then the node can have child nodes.
isComposite in class Nodepublic T getFirstChild()
Gets the first child node of this node.
public T getLastChild()
Gets the last child node of this node.
public List<T> getChildren()
Gets all child nodes of this node as an enumerable collection.
public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<T> iterator()
Returns an enumerator that iterates through child nodes of the CompositeNode{T}.
iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T extends INode>iterator in interface com.aspose.ms.System.Collections.IEnumerable<T extends INode>iterator in interface Iterable<T extends INode>T:IEnumerator`1 for the CompositeNode{T}.public <T1 extends T> T1 insertChild(int i, T1 newChild)
Inserts the node to the specified position in the list of child nodes for this node.
i - Position to insertnewChild - The node to insert.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.
i - Position to insertnewChildren - The sequence of nodes to be inserted.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.
i - Position to insertnewChildren - The sequence of nodes to be inserted.public <T1 extends T> T1 appendChildFirst(T1 newChild)
Adds the node to the front of the list of child nodes for this node.
newChild - The node to add.public <T1 extends T> T1 appendChildLast(T1 newChild)
Adds the node to the end of the list of child nodes for this node.
newChild - The node to add.public <T1 extends T> T1 removeChild(T1 oldChild)
Removes the child node.
oldChild - The node to remove.public void accept(DocumentVisitor visitor)
Accepts the visitor of the node.
public <T1 extends INode> List<T1> getChildNodes(Class<T1> typeParameterClass)
Get all child nodes by the node type.
getChildNodes in interface ICompositeNodeT1: The type of elements in the returned list.
Copyright (c) 2002-2021 Aspose. All Rights Reserved.