Class Node

java.lang.Object
  |
  +--Node

public class Node
extends java.lang.Object

Node class An object that contains a reference to a Object object and a reference to another Node. Allows a Node to be inserted into a list at construction. Supports linking a subsequent object to this Node, will return the reference to the next Node, or the reference to the data Object. However, the data object is immutable once the object is constructed.


Constructor Summary
Node(java.lang.Comparable initValue, Node initNext)
          constructor builds the Node with the supplied parameters
 
Method Summary
 java.lang.Comparable getData()
          returns reference to the data value of the object
 Node getNext()
          returns reference to the next Node
 void setNext(Node obj)
          sets the next reference of this object to the paramter object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(java.lang.Comparable initValue,
            Node initNext)
constructor builds the Node with the supplied parameters
Parameters:
data - object (must be Comparable)
link - to a next Node, or null
Method Detail

getNext

public Node getNext()
returns reference to the next Node
Returns:
next reference

setNext

public void setNext(Node obj)
sets the next reference of this object to the paramter object
Parameters:
next - Node

getData

public java.lang.Comparable getData()
returns reference to the data value of the object
Returns:
reference to the Comparable data in the Node