All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class rpi.goldsd.container.ListNode

java.lang.Object
   |
   +----rpi.goldsd.container.ListNode

public class ListNode
extends Object
implements Comparable, Linkable
The ListNode class represents a single node of the LinkedList container class by implementing the Linkable interface. Note that the Comparable interface is also implemented by simply invoking the underlying interface of the Comparable object that is stored in this ListNode.

Version:
1.3, 4/16/98
Author:
David Goldschmidt
See Also:
LinkedList, Linkable, Comparable

Variable Index

 o data
The data associated with this ListNode must implement the Comparable interface.
 o next
Identifies the next ListNode object in the corresponding LinkedList object.
 o previous
Identifies the previous ListNode object in the corresponding LinkedList object.

Constructor Index

 o ListNode()
The default constructor is not to be invoked.
 o ListNode(Comparable)
The constructor contains a single required argument that represents the Comparable object to be stored in this ListNode.

Method Index

 o getData()
Returns the Comparable object stored in this ListNode.
 o getNext()
Returns a reference to the next Linkable object that follows this ListNode.
 o getPrevious()
Returns a reference to the previous Linkable object that precedes this ListNode.
 o isEqualTo(Comparable)
Compares this ListNode to either another ListNode object or to another Comparable object (presumably of the same type of the data associated with this ListNode).
 o isLessThan(Comparable)
Compares this ListNode to either another ListNode object or to another Comparable object (presumably of the same type of the data associated with this ListNode).
 o setData(Comparable)
Sets the Comparable object stored in this ListNode.
 o setNext(Linkable)
Establishes a link to the next Linkable object in the list.
 o setPrevious(Linkable)
Establishes a link to the previous Linkable object in the list.
 o toString()
The toString() is the default method used to display this ListNode object in the form of a String object.

Variables

 o data
 protected Comparable data
The data associated with this ListNode must implement the Comparable interface.

 o next
 protected ListNode next
Identifies the next ListNode object in the corresponding LinkedList object.

 o previous
 protected ListNode previous
Identifies the previous ListNode object in the corresponding LinkedList object.

Constructors

 o ListNode
 public ListNode(Comparable data)
The constructor contains a single required argument that represents the Comparable object to be stored in this ListNode.

Parameters:
data - the Comparable object to be stored in this ListNode.
 o ListNode
 protected ListNode()
The default constructor is not to be invoked.

Methods

 o getData
 public Comparable getData()
Returns the Comparable object stored in this ListNode.

Returns:
the Comparable object stored in this ListNode.
 o getNext
 public Linkable getNext()
Returns a reference to the next Linkable object that follows this ListNode.

Returns:
a reference to the next Linkable object that follows this ListNode.
 o getPrevious
 public Linkable getPrevious()
Returns a reference to the previous Linkable object that precedes this ListNode.

Returns:
a reference to the previous Linkable object that precedes this ListNode.
 o isEqualTo
 public boolean isEqualTo(Comparable C)
Compares this ListNode to either another ListNode object or to another Comparable object (presumably of the same type of the data associated with this ListNode).

Returns:
true if this ListNode is determined to be equal to the Comparable argument C; false otherwise.
 o isLessThan
 public boolean isLessThan(Comparable C)
Compares this ListNode to either another ListNode object or to another Comparable object (presumably of the same type of the data associated with this ListNode).

Returns:
true if this ListNode is determined to be less than the Comparable argument C; false otherwise.
 o setData
 public void setData(Comparable data)
Sets the Comparable object stored in this ListNode.

Parameters:
data - the Comparable object to be stored in this ListNode.
 o setNext
 public void setNext(Linkable node)
Establishes a link to the next Linkable object in the list.

Parameters:
node - the Linkable object to be linked as the next Linkable object after this ListNode.
 o setPrevious
 public void setPrevious(Linkable node)
Establishes a link to the previous Linkable object in the list.

Parameters:
node - the Linkable object to be linked as the previous Linkable object to this ListNode.
 o toString
 public String toString()
The toString() is the default method used to display this ListNode object in the form of a String object.

Returns:
a String representing this ListNode.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index