|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.toronto.cs.binarytree.BTNode
public class BTNode
This is a binary tree node.
Field Summary | |
---|---|
protected java.lang.Object |
Data
|
protected BTNode |
left
|
protected BTNode |
right
|
Constructor Summary | |
---|---|
BTNode()
Constructs a new BTNode assigning null to Data, right and left. |
|
BTNode(java.lang.Object d)
Constructs a new BTNode contaning the specified Object as its Data and sets right and left to null. |
|
BTNode(java.lang.Object d,
BTNode l,
BTNode r)
Constructs a new BTNode with given data as well as left and right children. |
Method Summary | |
---|---|
java.lang.Object |
getData()
Retrieves the Data from the BTNode. |
BTNode |
getLeft()
Retrieves the left child of the BTNode. |
BTNode |
getRight()
Retrieves the right child of the BTNode. |
void |
setData(java.lang.Object d)
Changes the Data from the BTNode. |
void |
setLeft(BTNode l)
Changes the left child of the BTNode. |
void |
setRight(BTNode r)
Changes the right child of the BTNode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object Data
protected BTNode right
protected BTNode left
Constructor Detail |
---|
public BTNode()
public BTNode(java.lang.Object d)
d
- data to be stored in the node.public BTNode(java.lang.Object d, BTNode l, BTNode r)
d
- data to be stored in the node.l
- left child.r
- right child.Method Detail |
---|
public java.lang.Object getData()
public BTNode getLeft()
public BTNode getRight()
public void setData(java.lang.Object d)
public void setLeft(BTNode l)
public void setRight(BTNode r)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |