public class MutableTreeNodeObject extends Object implements MutableTreeNode
| Modifier and Type | Field and Description |
|---|---|
protected Vector |
children
The children of this Node.
|
protected TreeNode |
parent
The parent of this Node.
|
| Constructor and Description |
|---|
MutableTreeNodeObject() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(MutableTreeNode ch)
Add a child to this TreeNode at the end of the child list.
|
boolean |
canExpand()
Returns whether this node is expandable.
|
void |
clearChildren() |
boolean |
collapse()
Tell it that it can release its children.
|
boolean |
expand()
Tell it to expand (ie gather its children).
|
TreeNode |
getChild(int index)
Get the child at the specified index.
|
int |
getChildCount()
Get the number of children that this object has.
|
Iterator |
getChildren()
Get an Iterator for the children.
|
TreeNode |
getParent()
Get the parent of this object.
|
int |
indexOfChild(TreeNode child)
Return the index of the specified child.
|
void |
insertChild(MutableTreeNode ch,
int index)
Insert a child at the specified index.
|
boolean |
isLeaf()
Returns whether this is a node or leaf.
|
void |
removeChild(MutableTreeNode ch)
Remove a child from this TreeNode.
|
void |
setParent(TreeNode p)
Set the parent of this TreeNode.
|
protected TreeNode parent
protected Vector children
public TreeNode getChild(int index)
TreeNodepublic Iterator getChildren()
TreeNodegetChildren in interface TreeNodepublic int getChildCount()
TreeNodegetChildCount in interface TreeNodepublic TreeNode getParent()
TreeNodepublic void setParent(TreeNode p)
MutableTreeNodesetParent in interface MutableTreeNodepublic void removeChild(MutableTreeNode ch)
MutableTreeNoderemoveChild in interface MutableTreeNodepublic void addChild(MutableTreeNode ch)
MutableTreeNodeaddChild in interface MutableTreeNodepublic void insertChild(MutableTreeNode ch, int index)
MutableTreeNodeinsertChild in interface MutableTreeNodepublic int indexOfChild(TreeNode child)
TreeNodeindexOfChild in interface TreeNodepublic boolean canExpand()
TreeNodepublic boolean expand()
TreeNodepublic boolean isLeaf()
TreeNodepublic boolean collapse()
TreeNodepublic void clearChildren()