API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. LinkedBlockingQueue View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractQueue
              LinkedBlockingQueue
Implements
 BlockingQueue
 Serializable
Subclasses
Description
public class LinkedBlockingQueue
  An optionally-bounded blocking queue based on linked nodes.
See also:   
Constructors
public LinkedBlockingQueue ()
Creates a LinkedBlockingQueue with a capacity of Integer.MAX_VALUE.
public LinkedBlockingQueue (Collection<Object> c)
  Creates a LinkedBlockingQueue with a capacity of Integer.MAX_VALUE, initially containing the elements of the given collection, added in traversal order of the collection's iterator.
public LinkedBlockingQueue (int capacity)
  Creates a LinkedBlockingQueue with the given (fixed) capacity.
Methods
Hide/Show inherited methods
public boolean add ( E e) [Inherited From AbstractQueue]
  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 addAll (Collection<Object> c) [Inherited From AbstractQueue]
  Adds all of the elements in the specified collection to this queue.
public void clear () [Overrides AbstractQueue]
  Atomically removes all of the elements from this queue.
public boolean contains (Object o) [Inherited From AbstractCollection]
  Returns true if this collection contains the specified element.
public boolean containsAll (Collection<Object> c) [Inherited From AbstractCollection]
  Returns true if this collection contains all of the elements in the specified collection.
public int drainTo (Collection<Object> c) [Specified in BlockingQueue]
 
public int drainTo (Collection<Object> c, int maxElements) [Specified in BlockingQueue]
 
public E element () [Inherited From AbstractQueue]
  Retrieves, but does not remove, the head of this queue.
public boolean isEmpty () [Inherited From AbstractCollection]
  Returns true if this collection contains no elements.
public Iterator< E> iterator () [Specified in AbstractCollection]
  Returns an iterator over the elements in this queue in proper sequence.
public boolean offer ( E e) [Specified in BlockingQueue]
  Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and false if this queue is full.
public boolean offer ( E e, long timeout, TimeUnit unit) throws InterruptedException [Specified in BlockingQueue]
  Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.
public E peek ()
public E poll ()
public E poll (long timeout, TimeUnit unit) throws InterruptedException [Specified in BlockingQueue]
public void put ( E e) throws InterruptedException [Specified in BlockingQueue]
  Inserts the specified element at the tail of this queue, waiting if necessary for space to become available.
public int remainingCapacity () [Specified in BlockingQueue]
  Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking.
public E remove () [Inherited From AbstractQueue]
  Retrieves and removes the head of this queue.
public boolean remove (Object o) [Overrides AbstractCollection] [Specified in BlockingQueue]
  Removes a single instance of the specified element from this queue, if it is present.
public boolean removeAll (Collection<Object> c) [Inherited From AbstractCollection]
  Removes all of this collection's elements that are also contained in the specified collection (optional operation).
public boolean retainAll (Collection<Object> c) [Inherited From AbstractCollection]
  Retains only the elements in this collection that are contained in the specified collection (optional operation).
public int size () [Specified in AbstractCollection]
  Returns the number of elements in this queue.
public E take () throws InterruptedException [Specified in BlockingQueue]
public Object toArray () [Overrides AbstractCollection]
  Returns an array containing all of the elements in this queue, in proper sequence.
public T toArray ( T a) [Overrides AbstractCollection]
  Returns an array containing all of the elements in this queue, in proper sequence; the runtime type of the returned array is that of the specified array.
public String toString () [Overrides AbstractCollection]
Fields
Hide/Show inherited fields
Nested Classes
  LinkedBlockingQueue.Node
Linked list node class
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar