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.
|
T |
appendChild(T newChild)
Deprecated.
|
T |
appendChildFirst(T newChild)
Adds the node to the front of the list of child nodes for this node.
|
T |
appendChildLast(T newChild)
Adds the node to the end of the list of child nodes for this node.
|
<T1 extends Node> |
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.
|
String |
getText()
Get all text from the node.
|
T |
insertChild(int i,
T 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} . |
T |
removeChild(T oldChild)
Removes the child node.
|
getDocument, getNextSibling, getNodeType, getParentNode, getPreviousSibling
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final boolean isComposite()
Checks whether the node is composite. If true then the node can have child nodes.
isComposite
in class Node
public 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 T insertChild(int i, T 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 T appendChildFirst(T newChild)
Adds the node to the front of the list of child nodes for this node.
newChild
- The node to add.public T appendChildLast(T newChild)
Adds the node to the end of the list of child nodes for this node.
newChild
- The node to add.@Deprecated public T appendChild(T newChild)
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.
newChild
- The node to add.public T removeChild(T oldChild)
Removes the child node.
oldChild
- The node to remove.public void accept(DocumentVisitor visitor)
Accepts the visitor of the node.
public <T1 extends Node> List<T1> getChildNodes(Class<T1> typeParameterClass)
Get all child nodes by the node type.
getChildNodes
in interface ICompositeNode
T1
: The type of elements in the returned list.
public String getText()
Get all text from the node.
Copyright (c) 2002-2018 Aspose. All Rights Reserved.