API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Deque View Source
Author(s)
Doug Lea
Josh Bloch
Since
1.6
Version
Serial
Hierarchy
 Iterable
      Collection
          Queue
              Deque
Subinterfaces
Description
public interface Deque
  A linear collection that supports element insertion and removal at both ends.
See also:   
Methods
Hide/Show inherited methods
public boolean add ( E e) [Specified in Queue]
  Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available.
public void addFirst ( E e)
  Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions.
public void addLast ( E e)
  Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions.
public boolean contains (Object o)
  Returns true if this deque contains the specified element.
public Iterator< E> descendingIterator ()
  Returns an iterator over the elements in this deque in reverse sequential order.
public E element () [Specified in Queue]
  Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque).
public E getFirst ()
  Retrieves, but does not remove, the first element of this deque.
public E getLast ()
  Retrieves, but does not remove, the last element of this deque.
public Iterator< E> iterator ()
  Returns an iterator over the elements in this deque in proper sequence.
public boolean offer ( E e) [Specified in Queue]
  Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.
public boolean offerFirst ( E e)
  Inserts the specified element at the front of this deque unless it would violate capacity restrictions.
public boolean offerLast ( E e)
  Inserts the specified element at the end of this deque unless it would violate capacity restrictions.
public E peek () [Specified in Queue]
  Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty.
public E peekFirst ()
  Retrieves, but does not remove, the first element of this deque, or returns null if this deque is empty.
public E peekLast ()
  Retrieves, but does not remove, the last element of this deque, or returns null if this deque is empty.
public E poll () [Specified in Queue]
  Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty.
public E pollFirst ()
  Retrieves and removes the first element of this deque, or returns null if this deque is empty.
public E pollLast ()
  Retrieves and removes the last element of this deque, or returns null if this deque is empty.
public E pop ()
  Pops an element from the stack represented by this deque.
public void push ( E e)
  Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available.
public E remove () [Specified in Queue]
  Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque).
public boolean remove (Object o)
  Removes the first occurrence of the specified element from this deque.
public E removeFirst ()
  Retrieves and removes the first element of this deque.
public boolean removeFirstOccurrence (Object o)
  Removes the first occurrence of the specified element from this deque.
public E removeLast ()
  Retrieves and removes the last element of this deque.
public boolean removeLastOccurrence (Object o)
  Removes the last occurrence of the specified element from this deque.
public int size ()
  Returns the number of elements in this deque.
Fields
Hide/Show inherited fields
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar