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)
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.
|
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 appendChild(T newChild)
Adds the node to the end of the list of child nodes for this node.
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) 2017 Aspose. All Rights Reserved.