|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectListnode<E>
E
- the generic type of the data content stored in the list
DO NOT EDIT OR HAND IN THIS CLASSpublic class Listnode<E>
The internal node structure of LinkedList
.
Field Summary | |
---|---|
private E |
data
A reference to the data item for this node. |
private Listnode<E> |
next
A reference to the next node in a singly linked chain of nodes. |
Constructor Summary | |
---|---|
Listnode(E data)
Constructs a new list node with no link to a next node in the chain. |
|
Listnode(E data,
Listnode<E> next)
Constructs a new list node with a link to the next node in a chain of nodes. |
Method Summary | |
---|---|
E |
getData()
Returns a reference to data item for this node. |
Listnode<E> |
getNext()
Returns a reference to the next node after this node. |
void |
setData(E data)
Changes what data is referenced by this node. |
(package private) void |
setNext(Listnode<E> next)
Changes what node is next after this node in a chain of node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private E data
private Listnode<E> next
Constructor Detail |
---|
public Listnode(E data)
data
- the data to be stored in this node. The data reference
may be null.public Listnode(E data, Listnode<E> next)
data
- the data to be stored in this node. May be null.next
- the node after this one. May be null.Method Detail |
---|
public E getData()
public Listnode<E> getNext()
public void setData(E data)
data
- the new datavoid setNext(Listnode<E> next)
the
- new next node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |