//jleblanc 5.3.06 //PAC //This Class Authored by Michael Lewis import java.util.Vector; public class Queue extends Vector { /** Creates a new instance of the Queue class. */ public Queue() {} /** * Adds an object to the queue. */ public void enqueue(Object item) { addElement(item); } /** * Removes an object from the queue. */ public synchronized Object dequeue() { Object obj = null; if (size() > 0) { obj = firstElement(); removeElementAt(0); } return obj; } /** * Checks whether the queue is empty. */ public boolean isEmpty() { return size() == 0; } }