API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. BlockingQueue View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Iterable
      Collection
          Queue
              BlockingQueue
Subinterfaces
Description
public interface BlockingQueue
  A Queue that additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.
See also:   
Methods
Hide/Show inherited methods
public boolean add ( E e) [Specified in Queue]
  Inserts the specified element into this queue 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 boolean contains (Object o)
  Returns true if this queue contains the specified element.
public int drainTo (Collection<Object> c)
  Removes all available elements from this queue and adds them to the given collection.
public int drainTo (Collection<Object> c, int maxElements)
  Removes at most the given number of available elements from this queue and adds them to the given collection.
public boolean offer ( E e) [Specified in Queue]
  Inserts the specified element into this queue 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 offer ( E e, long timeout, TimeUnit unit) throws InterruptedException
  Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.
public E poll (long timeout, TimeUnit unit) throws InterruptedException
  Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
public void put ( E e) throws InterruptedException
  Inserts the specified element into this queue, waiting if necessary for space to become available.
public int remainingCapacity ()
  Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking, or Integer.MAX_VALUE if there is no intrinsic limit.
public boolean remove (Object o)
  Removes a single instance of the specified element from this queue, if it is present.
public E take () throws InterruptedException
  Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
Fields
Hide/Show inherited fields
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar