ewe.data
Class MutableTreeNodeObject

java.lang.Object
  extended byewe.data.MutableTreeNodeObject
All Implemented Interfaces:
MutableTreeNode, TreeNode

public class MutableTreeNodeObject
extends Object
implements MutableTreeNode


Field Summary
protected  Vector children
          The children of this Node.
protected  TreeNode parent
          The parent of this Node.
 
Constructor Summary
MutableTreeNodeObject()
           
 
Method Summary
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

parent

protected TreeNode parent
The parent of this Node.


children

protected Vector children
The children of this Node. This will be NULL until children are added.

Constructor Detail

MutableTreeNodeObject

public MutableTreeNodeObject()
Method Detail

getChild

public TreeNode getChild(int index)
Description copied from interface: TreeNode
Get the child at the specified index.

Specified by:
getChild in interface TreeNode

getChildren

public Iterator getChildren()
Description copied from interface: TreeNode
Get an Iterator for the children.

Specified by:
getChildren in interface TreeNode

getChildCount

public int getChildCount()
Description copied from interface: TreeNode
Get the number of children that this object has.

Specified by:
getChildCount in interface TreeNode

getParent

public TreeNode getParent()
Description copied from interface: TreeNode
Get the parent of this object.

Specified by:
getParent in interface TreeNode

setParent

public void setParent(TreeNode p)
Description copied from interface: MutableTreeNode
Set the parent of this TreeNode.

Specified by:
setParent in interface MutableTreeNode

removeChild

public void removeChild(MutableTreeNode ch)
Description copied from interface: MutableTreeNode
Remove a child from this TreeNode.

Specified by:
removeChild in interface MutableTreeNode

addChild

public void addChild(MutableTreeNode ch)
Description copied from interface: MutableTreeNode
Add a child to this TreeNode at the end of the child list. If the child is already in the child list it will be removed and then added to the end.

Specified by:
addChild in interface MutableTreeNode

insertChild

public void insertChild(MutableTreeNode ch,
                        int index)
Description copied from interface: MutableTreeNode
Insert a child at the specified index. If the index is greater than the number of children, the child will be appended to the child list. If the child is already in the child list it will be removed and then re-inserted at the specified index.

Specified by:
insertChild in interface MutableTreeNode

indexOfChild

public int indexOfChild(TreeNode child)
Description copied from interface: TreeNode
Return the index of the specified child. This will return -1 if the parameter is not a child of this TreeNode.

Specified by:
indexOfChild in interface TreeNode

canExpand

public boolean canExpand()
Description copied from interface: TreeNode
Returns whether this node is expandable.

Specified by:
canExpand in interface TreeNode

expand

public boolean expand()
Description copied from interface: TreeNode
Tell it to expand (ie gather its children).

Specified by:
expand in interface TreeNode

isLeaf

public boolean isLeaf()
Description copied from interface: TreeNode
Returns whether this is a node or leaf.

Specified by:
isLeaf in interface TreeNode

collapse

public boolean collapse()
Description copied from interface: TreeNode
Tell it that it can release its children.

Specified by:
collapse in interface TreeNode