|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.Node
public class Node
A class supporting a singly linked list element. Each element maintains a single reference to the next node in the list.
Field Summary | |
---|---|
protected java.lang.Object |
data
The data value stored in this node. |
protected Node |
nextElement
Reference to the next node in the list. |
Constructor Summary | |
---|---|
Node(java.lang.Object v)
Constructs a singly linked list element not associated with any list. |
|
Node(java.lang.Object v,
Node next)
Construct a singly linked list element. |
Method Summary | |
---|---|
Node |
next()
|
void |
setNext(Node next)
Update the next element. |
void |
setValue(java.lang.Object value)
Set the value associated with this element. |
java.lang.String |
toString()
Construct a string representation of element. |
java.lang.Object |
value()
Fetch the value associated with this element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object data
protected Node nextElement
Constructor Detail |
---|
public Node(java.lang.Object v, Node next)
v
- The value to be referenced by this element.next
- A reference to the next value in the list.public Node(java.lang.Object v)
v
- The value to be inserted into the nodeMethod Detail |
---|
public Node next()
public void setNext(Node next)
next
- The new value of the next element reference.public java.lang.Object value()
public void setValue(java.lang.Object value)
value
- The new value to be associated with this element.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |