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)
TreeNode
public Iterator getChildren()
TreeNode
getChildren
in interface TreeNode
public int getChildCount()
TreeNode
getChildCount
in interface TreeNode
public TreeNode getParent()
TreeNode
public void setParent(TreeNode p)
MutableTreeNode
setParent
in interface MutableTreeNode
public void removeChild(MutableTreeNode ch)
MutableTreeNode
removeChild
in interface MutableTreeNode
public void addChild(MutableTreeNode ch)
MutableTreeNode
addChild
in interface MutableTreeNode
public void insertChild(MutableTreeNode ch, int index)
MutableTreeNode
insertChild
in interface MutableTreeNode
public int indexOfChild(TreeNode child)
TreeNode
indexOfChild
in interface TreeNode
public boolean canExpand()
TreeNode
public boolean expand()
TreeNode
public boolean isLeaf()
TreeNode
public boolean collapse()
TreeNode
public void clearChildren()