public class LinkedDeque<E> extends Object implements Deque<E>
DoublyLinkedList
Constructor and Description |
---|
LinkedDeque()
Creates an empty deque.
|
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.
|
String |
toString()
Produces a string representation of the contents of the deque.
|
public int size()
Deque
public boolean isEmpty()
Deque
public E first()
Deque
public E last()
Deque
public void addFirst(E e)
Deque
public void addLast(E e)
Deque
public E removeFirst()
Deque
removeFirst
in interface Deque<E>
public E removeLast()
Deque
removeLast
in interface Deque<E>