next up previous index
Next: Implementation Up: Queues Previous: Methods   Index


Interface

We now follow the same course as before by providing a simple Queue interface. The essentials are shown in Figure 3.2.

Figure 3.2: An interface for the Queue abstract data type.
public interface Queue {
    public boolean isEmpty();
    public void enqueue(Object item);
    public Object dequeue();
}

Again there is no isFull method since we shall use an expanding array as before.



Peter Williams 2005-06-07