Difference between revisions of "Computer Science/61b/Homework/hw4/list/DListNode.java"

From lensowiki
< Computer Science‎ | 61b‎ | Homework‎ | hw4‎ | list
Jump to: navigation, search
(No difference)

Revision as of 22:04, 26 April 2007

/* DListNode.java */

package list;

/**
*  A DListNode is a node in a DList (doubly-linked list).
 */

public class DListNode {
	
	/**
	*  item references the item stored in the current node.
	 *  prev references the previous node in the DList.
	 *  next references the next node in the DList.
	 *
	 *  DO NOT CHANGE THE FOLLOWING FIELD DECLARATIONS.
	 */
	
	public Object item;
	protected DListNode prev;
	protected DListNode next;
	
	/**
		*  DListNode() constructor.
	 *  @param i the item to store in the node.
	 *  @param p the node previous to this node.
	 *  @param n the node following this node.
	 */
	DListNode(Object i, DListNode p, DListNode n) {
		item = i;
		prev = p;
		next = n;
	}
}