import java.util.*;
/**
 * SyncList is a synchronized Queue, it wraps a linkedList and allows for 
 * synchronization.
 * */
public class SyncList {
	/**
	 * The LinkedList being wrapped
	 * */
	private LinkedList list = new LinkedList();
	/**
	 * add's an object to the tail of the queue
	 * @param o the object to add to the queue
	 * */
	public synchronized void add(Object o) {
		list.add(o);
	}
	/**
	 * is the queue is empty
	 * @return true if empty false otherwise
	 * */
	public synchronized boolean isEmpty() {
		return list.isEmpty();
	}
	/**
	 * removes the first element from the list and returns it
	 * @return Object the first element from the list
	 * */
	public synchronized Object removeFirst() {
		return list.removeFirst();
	}
	/**
	 * adds an Object to the head of the list
	 * @param o the object to add to the head of the list
	 * */
	public synchronized void addFirst(Object o) {
		list.addFirst(o);
	}
}
