Java java.util PriorityQueue fields, constructors, methods, implement or subclass

Example usage for Java java.util PriorityQueue fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util PriorityQueue.

The text is from its open source code.

Subclass

java.util.PriorityQueue has subclasses.
Click this link to see all its subclasses.

Field

intsize
The number of elements in the priority queue.
Comparatorcomparator
The comparator, or null if priority queue uses elements' natural ordering.

Constructor

PriorityQueue(int initialCapacity)
Creates a PriorityQueue with the specified initial capacity that orders its elements according to their Comparable natural ordering .
PriorityQueue(Comparator comparator)
Creates a PriorityQueue with the default initial capacity and whose elements are ordered according to the specified comparator.
PriorityQueue(Collection c)
Creates a PriorityQueue containing the elements in the specified collection.
PriorityQueue(PriorityQueue c)
Creates a PriorityQueue containing the elements in the specified priority queue.
PriorityQueue(SortedSet c)
Creates a PriorityQueue containing the elements in the specified sorted set.
PriorityQueue()
Creates a PriorityQueue with the default initial capacity (11) that orders its elements according to their Comparable natural ordering .
PriorityQueue(int initialCapacity, Comparator comparator)
Creates a PriorityQueue with the specified initial capacity that orders its elements according to the specified comparator.

Method

booleanadd(E e)
Inserts the specified element into this priority queue.
voidclear()
Removes all of the elements from this priority queue.
booleancontains(Object o)
Returns true if this queue contains the specified element.
Iteratoriterator()
Returns an iterator over the elements in this queue.
booleanoffer(E e)
Inserts the specified element into this priority queue.
Epeek()
Epoll()
booleanremove(Object o)
Removes a single instance of the specified element from this queue, if it is present.
booleanremoveIf(Predicate filter)
Object[]toArray()
Returns an array containing all of the elements in this queue.
T[]toArray(T[] a)
Returns an array containing all of the elements in this queue; the runtime type of the returned array is that of the specified array.