Opus5
Interface Deque

All Superinterfaces:
Comparable, Container
All Known Implementing Classes:
DequeAsLinkedList, DequeAsArray

public interface Deque
extends Container

Encapsulates methods common to all deques (double-ended queues).

Version:
$Id: Deque.java,v 3.1 1998/07/28 01:32:17 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Field Summary
static java.lang.String copyright
           
 
Method Summary
 java.lang.Object dequeueHead()
          Dequeues and returns the object at the head of this deque.
 java.lang.Object dequeueTail()
          Dequeues and returns the object at the tail of this deque.
 void enqueueHead(java.lang.Object object)
          Enqueues the specified object at the head of this deque.
 void enqueueTail(java.lang.Object object)
          Enqueues the specified object at the tail of this deque.
 java.lang.Object getHead()
          Returns the object at the head of the deque.
 java.lang.Object getTail()
          Returns the object at the tail of the deque.
 
Methods inherited from interface Opus5.Container
accept, getCount, getEnumeration, isEmpty, isFull, purge
 
Methods inherited from interface Opus5.Comparable
compare, isEQ, isGE, isGT, isLE, isLT, isNE
 

Field Detail

copyright

public static final java.lang.String copyright
Method Detail

getHead

public java.lang.Object getHead()
Returns the object at the head of the deque.
Returns:
The object at the head of the deque.
Throws:
ContainerEmptyException - If the deque is empty.

getTail

public java.lang.Object getTail()
Returns the object at the tail of the deque.
Returns:
The object at the tail of the deque.
Throws:
ContainerEmptyException - If the deque is empty.

enqueueHead

public void enqueueHead(java.lang.Object object)
Enqueues the specified object at the head of this deque.
Parameters:
object - The object to be enqueued.
Throws:
ContainerFullException - If the deque is full.

enqueueTail

public void enqueueTail(java.lang.Object object)
Enqueues the specified object at the tail of this deque.
Parameters:
object - The object to be enqueued.
Throws:
ContainerFullException - If the deque is full.

dequeueHead

public java.lang.Object dequeueHead()
Dequeues and returns the object at the head of this deque.
Returns:
The object at the head of the deque.
Throws:
ContainerEmptyException - If the deque is empty.

dequeueTail

public java.lang.Object dequeueTail()
Dequeues and returns the object at the tail of this deque.
Returns:
The object at the tail of the deque.
Throws:
ContainerEmptyException - If the deque is empty.