|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--DLDeque
DLDeque is an implementation of Deque, a repository for Objects. that maintains insertion order. Objects can be inserted and removed from either in. Objects are inserted using enqueue and removed using dequeue. A doubly-linked list is used to maintain the Deque.
| Nested Class Summary | |
(package private) class |
DLDeque.Dcell
A Dcell stores one Object in the Queue and points to the immediately following and preceding Dcells, if any. |
| Field Summary | |
(package private) DLDeque.Dcell |
back
the Dcell at the back |
(package private) DLDeque.Dcell |
front
the Dcell at the front |
| Constructor Summary | |
DLDeque()
Construct an empty DLDeque. |
|
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
DLDeque.Dcell front
DLDeque.Dcell back
| Constructor Detail |
public DLDeque()
| Method Detail |
public void enqueueBack(java.lang.Object item)
enqueueBack in interface Dequeitem - the Object to be inserted
public java.lang.Object dequeueFront()
throws EmptyQueueException
dequeueFront in interface DequeEmptyQueueException - if the Queue is emptypublic void enqueueFront(java.lang.Object item)
enqueueFront in interface Dequeitem - the Object to be inserted
public java.lang.Object dequeueBack()
throws EmptyQueueException
dequeueBack in interface DequeEmptyQueueException - if the Queue is emptypublic boolean isEmpty()
isEmpty in interface Deque
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||