|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for a deque, or double-ended queue.
A deque is a collection of linearly arranged elements that are accessed, inserted, and removed at the beginning or at the end.
DequeEmptyException,
Queue,
Stack| Method Summary | |
java.lang.Object |
first()
Gets the first element (without modifying the deque). |
void |
insertFirst(java.lang.Object element)
Insert an element at the beginning. |
void |
insertLast(java.lang.Object element)
Insert an element at the end. |
boolean |
isEmpty()
Tests if this deque is empty |
java.lang.Object |
last()
Gets the last element (without modifying the deque). |
java.lang.Object |
removeFirst()
Remove the element at the beginning. |
java.lang.Object |
removeLast()
Remove the element at the end. |
int |
size()
Gets the number of elements. |
| Method Detail |
public java.lang.Object first()
throws DequeEmptyException
public java.lang.Object last()
throws DequeEmptyException
public boolean isEmpty()
true if the deque is empty, false
otherwise.public int size()
public void insertFirst(java.lang.Object element)
element - new element to be inserted.public void insertLast(java.lang.Object element)
element - new element to be inserted.
public java.lang.Object removeFirst()
throws DequeEmptyException
public java.lang.Object removeLast()
throws DequeEmptyException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||