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
Method | Description |
---|---|
<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:
Parameter | Type | Description |
---|---|---|
newChild | T1 | The 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:
Parameter | Type | Description |
---|---|---|
newChild | T1 | The 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:
Parameter | Type | Description |
---|---|---|
typeParameterClass | java.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:
Parameter | Type | Description |
---|---|---|
i | int | Position to insert |
newChild | T1 | The node to insert. |
Returns: T1 - The added node.
<T1>removeChild(T1 oldChild)
public T1 <T1>removeChild(T1 oldChild)
Removes the child node.
Parameters:
Parameter | Type | Description |
---|---|---|
oldChild | T1 | The node to remove. |
Returns: T1 - The removed node.
accept(DocumentVisitor visitor)
public void accept(DocumentVisitor visitor)
Accepts the visitor of the node.
Parameters:
Parameter | Type | Description |
---|---|---|
visitor | DocumentVisitor | The 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:
Parameter | Type | Description |
---|---|---|
i | int | Position to insert |
newChildren | T[] | 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:
Parameter | Type | Description |
---|---|---|
i | int | Position to insert |
newChildren | java.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:IEnumerator
1for the
CompositeNode{T}`.