/Users/petercappello/NetBeansProjects/56-2014/56-2014-JUnit/src/Queue.java |
import java.util.LinkedList;
@author
public class Queue<T>
{
private final LinkedList<T> q = new LinkedList<>();
Answers the question is the queue empty.
@return
public boolean isEmpty() { return q.isEmpty(); }
Removes and retrieves the queue's head element.
@return
@throws
public T remove() { return q.remove(); }
Enqueues an element on the queue.
@param element
public void add( T element ) { q.add( element ); }
Retrieves but does not remove the head element of the queue.
@return
@throws
public T peek() { return q.peek(); }
}