|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.bbk.dcs.automed.graph.TreeNode
public class TreeNode
Class that abstracts the node of a tree structure.
IMPORTANT: at the moment, the children of a tree node are a set and not a list.
| Constructor Summary | |
|---|---|
protected |
TreeNode(java.lang.String name)
|
| Method Summary | |
|---|---|
protected void |
addChild(TreeNode t)
Adds a node to the set of children of the node |
java.util.LinkedList |
getChildren()
|
java.lang.String |
getName()
|
TreeNode |
getParent()
|
protected boolean |
isLeaf()
|
boolean |
isRoot()
|
protected void |
setChildren(java.util.LinkedList s)
Sets the children of the node. |
void |
setName(java.lang.String name)
|
protected void |
setParent(TreeNode n)
Sets the parent node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected TreeNode(java.lang.String name)
name - the name of the node| Method Detail |
|---|
protected void setParent(TreeNode n)
n - the parent nodepublic boolean isRoot()
protected boolean isLeaf()
public TreeNode getParent()
public java.util.LinkedList getChildren()
protected void setChildren(java.util.LinkedList s)
s - the set of childrenprotected void addChild(TreeNode t)
t - the node to add in the set of childrenpublic java.lang.String getName()
public void setName(java.lang.String name)
name - the name that will be given to the tree node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||