API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. PriorityQueue View Source
Author(s)
Josh Bloch, Doug Lea
Since
1.5
Version
1.16, 04/21/06
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractQueue
              PriorityQueue
Implements
 Serializable
Subclasses
Description
public class PriorityQueue
  An unbounded priority queue based on a priority heap.
See also:   
Constructors
public PriorityQueue ()
Creates a PriorityQueue with the default initial capacity (11) that orders its elements according to their natural ordering.
public PriorityQueue (Collection<Object> c)
  Creates a PriorityQueue containing the elements in the specified collection.
public PriorityQueue (int initialCapacity)
  Creates a PriorityQueue with the specified initial capacity that orders its elements according to their natural ordering.
public PriorityQueue (int initialCapacity, Comparator<Object> comparator)
  Creates a PriorityQueue with the specified initial capacity that orders its elements according to the specified comparator.
public PriorityQueue (PriorityQueue<Object> c)
  Creates a PriorityQueue containing the elements in the specified priority queue.
public PriorityQueue (SortedSet<Object> c)
  Creates a PriorityQueue containing the elements in the specified sorted set.
Methods
Hide/Show inherited methods
public boolean add ( E e) [Overrides AbstractQueue]
  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]
  Removes all of the elements from this priority queue.
public Comparator<Object> comparator ()
  Returns the comparator used to order the elements in this queue, or null if this queue is sorted according to the natural ordering of its elements.
public boolean contains (Object o) [Overrides AbstractCollection]
  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 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)
  Inserts the specified element into this priority queue.
public E peek ()
public E poll ()
public E remove () [Inherited From AbstractQueue]
  Retrieves and removes the head of this queue.
public boolean remove (Object o) [Overrides AbstractCollection]
  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).
pack-private boolean removeEq (Object o)
  Version of remove using reference equality, not equals.
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 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 () [Inherited From AbstractCollection]
  Returns a string representation of this collection.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar