|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectintroExam.BinarySearchTree.BST.BSTNode
Field Summary | |
BST.BSTNode |
left
|
BST.BSTNode |
right
|
java.lang.Comparable |
value
Note final access modifier: cannot be changed!
Also, there is no setter for value . |
Constructor Summary | |
BST.BSTNode(java.lang.Comparable value)
Constructor builds the BSTNode with the supplied parameter; it has empty subtrees. |
|
BST.BSTNode(java.lang.Comparable value,
BST.BSTNode left,
BST.BSTNode right)
Constructor builds the BSTNode with the supplied parameters. |
Method Summary | |
BST.BSTNode |
getLeft()
Returns reference to the left child, or null, if none. |
BST.BSTNode |
getRight()
Returns reference to the right child, or null, if none. |
java.lang.Comparable |
getValue()
Returns reference to the value of the object. |
void |
setLeft(BST.BSTNode newLeftChild)
Sets the left-child reference of this object to the parameter object. |
void |
setRight(BST.BSTNode newRightChild)
Sets the right-child reference of this object to the parameter object. |
java.lang.String |
toString()
Returns string representation of the object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final java.lang.Comparable value
final
access modifier: cannot be changed!
Also, there is no setter for value
.
public BST.BSTNode left
public BST.BSTNode right
Constructor Detail |
public BST.BSTNode(java.lang.Comparable value)
value
- to store in this nodepublic BST.BSTNode(java.lang.Comparable value, BST.BSTNode left, BST.BSTNode right)
value
- to store in this nodeleft
- must refer to its left subtreeright
- must refer to its right subtreeMethod Detail |
public BST.BSTNode getLeft()
public BST.BSTNode getRight()
public void setLeft(BST.BSTNode newLeftChild)
newLeftChild
- which is an object of the class BSTNodepublic void setRight(BST.BSTNode newRightChild)
newRightChild
- which is an object of the class BSTNodepublic java.lang.Comparable getValue()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |