import ObjectNode;

/**  
 * LinkedList class: stores a linked list of Objects
 *   @author Dave Reed  
 *   @version 11/4/00  
 */
public class LinkedList
{
    private ObjectNode front;  // reference to front of list

	/**
	 * Constructs an empty linked list
	 */
    public LinkedList() 
	{
        front = null;
    }

    /**
	 * Inserts an object at the front of the linked list.
	 *   @param obj  the object to be inserted
	 */
    public void Insert(Object obj) 
	{
        ObjectNode newNode = new ObjectNode();
        newNode.data = obj;
        newNode.next = front;
		front = newNode;
    }
	
	/**
	 * Displays the contents of the linked list.
	 */
	public void Display() 
	{
		ObjectNode current = front;
        while (current != null) {
           System.out.println(current.data);
           current = current.next;
        }
    }
	
} 
