net.datastructures
Class Node
java.lang.Object
net.datastructures.Node
- public class Node
- extends Object
Node of a singly linked list, which stores references to its
element and to the next node in the list.
- Author:
- Natasha Gelfand, Roberto Tamassia, Michael Goodrich
Constructor Summary |
Node()
Creates a node with null references to its element and next node. |
Node(Object e,
Node n)
Creates a node with the given element and next node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Node
public Node()
- Creates a node with null references to its element and next node.
Node
public Node(Object e,
Node n)
- Creates a node with the given element and next node.
getElement
public Object getElement()
getNext
public Node getNext()
setElement
public void setElement(Object newElem)
setNext
public void setNext(Node newNext)