Interface Deque

All Known Implementing Classes:
DLDeque

interface Deque

A Deque (double-ended queue) is a repository for objects that maintains insertion order. Objects can be inserted and removed from either in.


Method Summary
 java.lang.Object dequeueBack()
          Remove an Object from the back of the Deque.
 java.lang.Object dequeueFront()
          Remove an Object from the front of the Deque.
 void enqueueBack(java.lang.Object item)
          Insert an Object at the back of the Deque.
 void enqueueFront(java.lang.Object item)
          Insert an Object at the front of the Deque.
 boolean isEmpty()
          Indicate whether or not the Deque is empty
 

Method Detail

enqueueFront

public void enqueueFront(java.lang.Object item)
Insert an Object at the front of the Deque.

Parameters:
item - the Object to be inserted

dequeueBack

public java.lang.Object dequeueBack()
                             throws EmptyQueueException
Remove an Object from the back of the Deque.

Returns:
the Object removed
Throws:
EmptyQueueException - if the Queue is empty

enqueueBack

public void enqueueBack(java.lang.Object item)
Insert an Object at the back of the Deque.

Parameters:
item - the Object to be inserted

dequeueFront

public java.lang.Object dequeueFront()
                              throws EmptyQueueException
Remove an Object from the front of the Deque.

Returns:
the Object removed
Throws:
EmptyQueueException - if the Queue is empty

isEmpty

public boolean isEmpty()
Indicate whether or not the Deque is empty

Returns:
boolean indicating whether or not the Deque is empty