|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Deque<E>
Interface for a deque: a collection of objects that are inserted and removed at both ends; a subset of java.util.LinkedList methods.
Method Summary | |
---|---|
void |
addFirst(E element)
Inserts an element to be the first in the deque. |
void |
addLast(E element)
Inserts an element to be the last in the deque. |
E |
getFirst()
Returns the first element; an exception is thrown if deque is empty. |
E |
getLast()
Returns the last element; an exception is thrown if deque is empty. |
boolean |
isEmpty()
Returns whether the deque is empty. |
E |
removeFirst()
Removes the first element; an exception is thrown if deque is empty. |
E |
removeLast()
Removes the last element; an exception is thrown if deque is empty. |
int |
size()
Returns the number of elements in the deque. |
Method Detail |
---|
int size()
boolean isEmpty()
E getFirst() throws EmptyDequeException
EmptyDequeException
E getLast() throws EmptyDequeException
EmptyDequeException
void addFirst(E element)
void addLast(E element)
E removeFirst() throws EmptyDequeException
EmptyDequeException
E removeLast() throws EmptyDequeException
EmptyDequeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |