Class BSTTreeHead.NodeAndKey
java.lang.Object
|
+--BSTTreeHead.NodeAndKey
- Enclosing class:
- BSTTreeHead
- public class BSTTreeHead.NodeAndKey
- extends java.lang.Object
An object which keeps both a BSTTree node and an integer key. Useful when dealing with
waitingActions that must involve both a node and key. This class makes that possible
within one object.
Method Summary |
int |
getKey()
Gets the key for the object. |
BSTTree |
getNode()
Gets the node for the object. |
protected void |
setKey(int key)
Sets the key for the object. |
protected void |
setNode(BSTTree node)
Sets the node for the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BSTTreeHead.NodeAndKey
public BSTTreeHead.NodeAndKey()
- Constructor, making an empty NodeAndKey Object. Using the set methods, it can be
set.
BSTTreeHead.NodeAndKey
public BSTTreeHead.NodeAndKey(BSTTree node,
int key)
- Constructor, making a NodeAndKey Object with the speficied node and key.
- Parameters:
node
- BSTTree node for the current NodeAndKey.key
- int for the NodeAndKey.
setNode
protected void setNode(BSTTree node)
- Sets the node for the object.
- Parameters:
node
- BSTTree node for the object.
setKey
protected void setKey(int key)
- Sets the key for the object.
- Parameters:
key
- int for the object.
getNode
public BSTTree getNode()
- Gets the node for the object.
- Returns:
- BSTTree node for the object.
getKey
public int getKey()
- Gets the key for the object.
- Returns:
- int key for the object.