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
-
data
- The data associated with this ListNode must implement the
Comparable interface.
-
next
- Identifies the next ListNode object in the corresponding
LinkedList object.
-
previous
- Identifies the previous ListNode object in the corresponding
LinkedList object.
-
ListNode()
- The default constructor is not to be invoked.
-
ListNode(Comparable)
- The constructor contains a single required argument that represents
the Comparable object to be stored in this ListNode.
-
getData()
- Returns the Comparable object stored in this ListNode.
-
getNext()
- Returns a reference to the next Linkable object that follows
this ListNode.
-
getPrevious()
- Returns a reference to the previous Linkable object that
precedes this ListNode.
-
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).
-
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).
-
setData(Comparable)
- Sets the Comparable object stored in this ListNode.
-
setNext(Linkable)
- Establishes a link to the next Linkable object in the list.
-
setPrevious(Linkable)
- Establishes a link to the previous Linkable object in the list.
-
toString()
- The toString() is the default method used to display this
ListNode object in the form of a String object.
data
protected Comparable data
- The data associated with this ListNode must implement the
Comparable interface.
next
protected ListNode next
- Identifies the next ListNode object in the corresponding
LinkedList object.
previous
protected ListNode previous
- Identifies the previous ListNode object in the corresponding
LinkedList object.
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.
ListNode
protected ListNode()
- The default constructor is not to be invoked.
getData
public Comparable getData()
- Returns the Comparable object stored in this ListNode.
- Returns:
- the Comparable object stored in this ListNode.
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.
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.
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.
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.
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.
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.
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.
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