/**
 * Nodes used to build linked lists.  In Saul's words, "These are
 * really structures."
 *
 * @author Samuel A. Rebelsky
 */
class ListNode
  implements Position
{
  /**
   * The contents of the node.  Should never be null.
   */
  Object contents;

  /**
   * The next node in the list.  Should be null for the last
   * element of the list.
   */
  ListNode next;

  /**
   * Build a new node with a subsequent list.
   */
  public ListNode(Object contents, ListNode next)
  {
    this.contents = contents;
    this.next = next;
  } // ListNode(Object, ListNode)

  /**
   * Build a new node with no successor.
   */
  public ListNode(Object contents)
  {
    this(contents, null);
  } // ListNode(Object)

} // class ListNode

