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
Method | Description |
---|---|
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} . |
Inserts the node to the specified position in the list of child nodes for this node. | |
insertChildrenRange(int i, Iterable | 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. |
Adds the node to the front of the list of child nodes for this node. | |
Adds the node to the end of the list of child nodes for this node. | |
Removes the child node. | |
accept(DocumentVisitor visitor) | Accepts the visitor of the node. |
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
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.
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:
Parameter | Type | Description |
---|---|---|
i | int | Position to insert |
newChildren | java.lang.Iterable | The 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:
Parameter | Type | Description |
---|---|---|
i | int | Position to insert |
newChildren | T[] | 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:
Parameter | Type | Description |
---|---|---|
newChild | T1 | The 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:
Parameter | Type | Description |
---|---|---|
newChild | T1 | The node to add. |
Returns: T1 - The added node.
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 . |
getChildNodes(Class 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 |
Returns:
java.util.List
T1 : The type of elements in the returned list.