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.
|
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 java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
DequeAsLinkedList
public DequeAsLinkedList()
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.