net.datastructures
Class Node<E>

java.lang.Object
  extended by net.datastructures.Node<E>

public class Node<E>
extends java.lang.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(E e, Node<E> n)
          Creates a node with the given element and next node.
 
Method Summary
 E getElement()
           
 Node<E> getNext()
           
 void setElement(E newElem)
           
 void setNext(Node<E> newNext)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node()
Creates a node with null references to its element and next node.


Node

public Node(E e,
            Node<E> n)
Creates a node with the given element and next node.

Method Detail

getElement

public E getElement()

getNext

public Node<E> getNext()

setElement

public void setElement(E newElem)

setNext

public void setNext(Node<E> newNext)