/*
  Node.java from ftp://ftp.aw.com/cseng/authors/carrano/java/code.zip
    which is a zip of code from Carrano and Prichard's book 
    Data Abstraction and Problem Solving with Java: Walls and Mirrors.
*/

public class Node {

  private Object item;
  private Node next;

  public Node(Object newItem) {
    item = newItem;
    next = null;
  } // end constructor

  public Node(Object newItem, Node nextNode) {
    item = newItem;
    next = nextNode;
  } // end constructor

  public void setItem(Object newItem) {
    item = newItem;
  } // end setItem

  public Object getItem() {
    return item;
  } // end getItem

  public void setNext(Node nextNode) {
    next = nextNode;
  } // end setNext

  public Node getNext() {
    return next;
  } // end getNext
} // end class Node

