API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. PriorityBlockingQueue View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractQueue
              PriorityBlockingQueue
Implements
 BlockingQueue
 Serializable
Subclasses
Description
public class PriorityBlockingQueue
  An unbounded blocking queue that uses the same ordering rules as class PriorityQueue and supplies blocking retrieval operations.
See also:   
Constructors
public PriorityBlockingQueue ()
Creates a PriorityBlockingQueue with the default initial capacity (11) that orders its elements according to their natural ordering.
public PriorityBlockingQueue (Collection<Object> c)
  Creates a PriorityBlockingQueue containing the elements in the specified collection.
public PriorityBlockingQueue (int initialCapacity)
  Creates a PriorityBlockingQueue with the specified initial capacity that orders its elements according to their natural ordering.
public PriorityBlockingQueue (int initialCapacity, Comparator<Object> comparator)
  Creates a PriorityBlockingQueue with the specified initial capacity that orders its elements according to the specified comparator.
Methods
Hide/Show inherited methods
public boolean add ( E e) [Overrides AbstractQueue] [Specified in BlockingQueue]
  Inserts the specified element into this priority queue.
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 Comparator<Object> comparator ()
  Returns the comparator used to order the elements in this queue, or null if this queue uses the natural ordering of its elements.
public boolean contains (Object o) [Overrides AbstractCollection] [Specified in BlockingQueue]
  Returns true if this queue 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.
public boolean offer ( E e) [Specified in BlockingQueue]
  Inserts the specified element into this priority queue.
public boolean offer ( E e, long timeout, TimeUnit unit) [Specified in BlockingQueue]
  Inserts the specified element into this priority queue.
public E peek ()
public E poll ()
public E poll (long timeout, TimeUnit unit) throws InterruptedException [Specified in BlockingQueue]
public void put ( E e) [Specified in BlockingQueue]
  Inserts the specified element into this priority queue.
public int remainingCapacity () [Specified in BlockingQueue]
  Always returns Integer.MAX_VALUE because a PriorityBlockingQueue is not capacity constrained.
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]
public E take () throws InterruptedException [Specified in BlockingQueue]
public Object toArray () [Overrides AbstractCollection]
  Returns an array containing all of the elements in this queue.
public T toArray ( T a) [Overrides AbstractCollection]
  Returns an array containing all of the elements in this queue; 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
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar