|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectclasspathhelper.util.AbstractTree
Abstract base class for a tree node. This class provides basic tree structure related methods for maintaining children and parents.
This class is intended to be subclassed to provide a specific functionality. The helper methods for children automatically handle dispatching notifications.
| Constructor Summary | |
AbstractTree()
|
|
| Method Summary | |
void |
addChild(ITree node)
Adds a new node as a child to this tree node. |
void |
addChildren(ITree[] nodes)
Adds a new array of children to this tree node. |
ITree[] |
getChildren()
Getter for this nodes children. |
ITree |
getParent()
Getter for the parent of this node. |
protected ITreeRoot |
getRoot()
Returns the root of this tree. |
boolean |
hasChildren()
Does this node have children. |
void |
removeAllChildren()
Method to remove all children from this node. |
void |
removeChild(ITree node)
Method for removing a child node. |
void |
setParent(ITree theParent)
Method for setting the parent of this node. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface classpathhelper.util.ITree |
getIconName |
| Constructor Detail |
public AbstractTree()
| Method Detail |
public void addChild(ITree node)
node - The child node to add.public void addChildren(ITree[] nodes)
nodes - The children nodes to add.public void removeChild(ITree node)
node - The node to remove.public void removeAllChildren()
public void setParent(ITree theParent)
addChild(ITree)
method and doesn't need to be called directly.
theParent - The parent node.protected ITreeRoot getRoot()
public boolean hasChildren()
ITree
hasChildren in interface ITreetrue if this node has children
otherwise falsepublic ITree[] getChildren()
ITree
getChildren in interface ITreepublic ITree getParent()
ITree
getParent in interface ITreenull
if this nood is the root or
if this node has not yet been added to a tree.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||