T
- the actual implementation type of this MutableTreeNodeImplpublic class MutableTreeNodeImpl<T extends MutableTreeNode<T>> extends Object implements MutableTreeNode<T>
MutableTreeNode
.Constructor and Description |
---|
MutableTreeNodeImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(int index,
T child)
Adds the given child to this nodes children list and setting the childs parent field to this node.
|
List<T> |
getChildren()
Returns the sub nodes of this node.
|
T |
getParent()
Returns the parent node or null if this node is the root.
|
T |
removeChild(int index)
Removes the child with the given index.
|
void |
setChild(int index,
T child)
Sets the child node at the given index to the given node.
|
public T getParent()
TreeNode
getParent
in interface TreeNode<T extends MutableTreeNode<T>>
public List<T> getChildren()
GraphNode
getChildren
in interface GraphNode<T extends MutableTreeNode<T>>
public void addChild(int index, T child)
MutableTreeNode
addChild
in interface MutableTreeNode<T extends MutableTreeNode<T>>
index
- the index under which to insert this child into the children listchild
- the child node to addpublic void setChild(int index, T child)
MutableTreeNode
setChild
in interface MutableTreeNode<T extends MutableTreeNode<T>>
index
- the index under which to set this child into the children listchild
- the child node to setpublic T removeChild(int index)
MutableTreeNode
removeChild
in interface MutableTreeNode<T extends MutableTreeNode<T>>
index
- the index of the child to remove.Copyright © 2020. All rights reserved.