public interface Deque<E>
Modifier and Type | Method and Description |
---|---|
void |
addFirst(E e)
Inserts an element at the front of the deque.
|
void |
addLast(E e)
Inserts an element at the back of the deque.
|
E |
first()
Returns (but does not remove) the first element of the deque.
|
boolean |
isEmpty()
Tests whether the deque is empty.
|
E |
last()
Returns (but does not remove) the last element of the deque.
|
E |
removeFirst()
Removes and returns the first element of the deque.
|
E |
removeLast()
Removes and returns the last element of the deque.
|
int |
size()
Returns the number of elements in the deque.
|
int size()
boolean isEmpty()
E first()
E last()
void addFirst(E e)
e
- the new elementvoid addLast(E e)
e
- the new elementE removeFirst()
E removeLast()