|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTreeDraw.LabelledTreeImpl
class LabelledTreeImpl
Sample implementation of a labelled tree, used to test the tree drawer.
Field Summary | |
---|---|
private LabelledTreeImpl[] |
children
The node's children. |
private java.lang.String |
label
The node's label. |
Constructor Summary | |
---|---|
LabelledTreeImpl(java.lang.String label,
LabelledTreeImpl[] children)
Builds a tree node. |
Method Summary | |
---|---|
void |
addChild(LabelledTreeImpl child)
Adds a child to this node. |
Tree |
getChild(int i)
Returns the i'th child (subtree) of this tree (node). |
java.lang.String |
getLabel()
Returns this tree node's label. |
int |
numChildren()
Returns the number of children of this tree node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private LabelledTreeImpl[] children
private java.lang.String label
Constructor Detail |
---|
public LabelledTreeImpl(java.lang.String label, LabelledTreeImpl[] children)
label
- The new node's label.children
- The new node's children.Method Detail |
---|
public void addChild(LabelledTreeImpl child)
child
- The child to add to the node.public int numChildren()
numChildren
in interface Tree
public Tree getChild(int i)
getChild
in interface Tree
public java.lang.String getLabel()
getLabel
in interface LabelledTree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |