E
- the generic type of the data content stored in the list
DO NOT EDIT OR HAND IN THIS CLASSpublic class Listnode<E>
extends java.lang.Object
LinkedList
.Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public Listnode(E data)
data
- the data to be stored in this node. The data reference
may be null.public E getData()
public Listnode<E> getNext()
public void setData(E data)
data
- the new data