Opus5
Class DequeAsLinkedList

java.lang.Object
  |
  +--Opus5.AbstractObject
        |
        +--Opus5.AbstractContainer
              |
              +--Opus5.QueueAsLinkedList
                    |
                    +--Opus5.DequeAsLinkedList
All Implemented Interfaces:
Comparable, Container, Deque, Queue

public class DequeAsLinkedList
extends QueueAsLinkedList
implements Deque

A deque (double-ended queue) implemented using a linked list.

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

Fields inherited from class Opus5.QueueAsLinkedList
list
 
Fields inherited from class Opus5.AbstractContainer
count
 
Fields inherited from interface Opus5.Deque
copyright
 
Fields inherited from interface Opus5.Queue
copyright
 
Constructor Summary
DequeAsLinkedList()
           
 
Method Summary
 java.lang.Object dequeueHead()
          Dequeues and returns the object at the head of this queue.
 java.lang.Object dequeueTail()
          Dequeues and returns the object at the tail of this queue.
 void enqueueHead(java.lang.Object object)
          Enqueues the specified object at the head of this queue.
 void enqueueTail(java.lang.Object object)
          Enqueues the specified object at the tail of this queue.
 java.lang.Object getTail()
          Returns the object at the tail of this deque.
 
Methods inherited from class Opus5.QueueAsLinkedList
accept, compareTo, dequeue, enqueue, getEnumeration, getHead, purge
 
Methods inherited from class Opus5.AbstractContainer
getCount, hashCode, isEmpty, isFull, toString
 
Methods inherited from class Opus5.AbstractObject
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Opus5.Deque
getHead
 
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
 

Constructor Detail

DequeAsLinkedList

public DequeAsLinkedList()
Method Detail

enqueueHead

public void enqueueHead(java.lang.Object object)
Enqueues the specified object at the head of this queue.
Specified by:
enqueueHead in interface Deque
Parameters:
object - The object to be enqueued.

dequeueHead

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

getTail

public java.lang.Object getTail()
Returns the object at the tail of this deque.
Specified by:
getTail in interface Deque
Returns:
the object at the tail of this deque.
Throws:
ContainerEmptyException - If this deque is empty.

enqueueTail

public void enqueueTail(java.lang.Object object)
Enqueues the specified object at the tail of this queue.
Specified by:
enqueueTail in interface Deque
Parameters:
object - The object to be enqueued.

dequeueTail

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