Class LinkedListNode
java.lang.Object
|
+--LinkedListNode
- public class LinkedListNode
- extends java.lang.Object
This is a node in a linked list. A node holds an Object, and a
to another LinkedListNode.
Constructor Summary |
LinkedListNode(java.lang.Object d)
Create a new LinkedListNode to hold the diven object. |
Method Summary |
java.lang.Object |
getData()
Get the Object stored in the LinkedListNode |
LinkedListNode |
getNext()
Get the next node in the LinkedList, possibly null |
protected void |
setNext(LinkedListNode n)
Make this LinkedListNode next pointer point to the given node. |
java.lang.String |
toString()
Return the string representation of this LinkedListNode. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
LinkedListNode
public LinkedListNode(java.lang.Object d)
- Create a new LinkedListNode to hold the diven object. The
pointer to the next LinkedListNode is set to null.
- Parameters:
d
- The Object to be stored in the LinkedListNode
setNext
protected void setNext(LinkedListNode n)
- Make this LinkedListNode next pointer point to the given node.
- Parameters:
n
- The LinkedListNode to make next in the LinkedList
getData
public java.lang.Object getData()
- Get the Object stored in the LinkedListNode
- Returns:
- The Object stored in this LinkedListNode
getNext
public LinkedListNode getNext()
- Get the next node in the LinkedList, possibly null
- Returns:
- The next node in the LinkedList
toString
public java.lang.String toString()
- Return the string representation of this LinkedListNode. This
method assumes that the Object stored in it has a method
ToString.
- Overrides:
- toString in class java.lang.Object
- Returns:
- The string representation of this segment.