/** DListNode is a class used internally by the List class.  Each
   node in a List is represented as a DListNode, with an Object
   item, a reference to the previous next node in the list, and a
   reference to the next node in the list.
   */

class DListNode {
  public Object item;
  public DListNode next;
  public DListNode previous;

  /** Constructs a DListNode with previous and next both null.
   *  @param value will be the item in this node.
   */
  DListNode(Object value) {
    item = value;
    next = null;
    previous = null;
  }

  /** Constructs a DListNode.
    * @param value will be the item in this node.
    * @param p will be previous in this node.
    * @param n will be next in this node.
    */
  DListNode(Object value, DListNode p, DListNode n) {
    item = value;
    next = n;
    previous = p;
  }
}