Example usage for Java java.util PriorityQueue fields, constructors, methods, implement or subclass
The text is from its open source code.
int | size The number of elements in the priority queue. |
Comparator | comparator The comparator, or null if priority queue uses elements' natural ordering. |
PriorityQueue(int initialCapacity) Creates a PriorityQueue with the specified initial capacity that orders its elements according to their Comparable natural ordering . | |
PriorityQueue(Comparator super E> comparator) Creates a PriorityQueue with the default initial capacity and whose elements are ordered according to the specified comparator. | |
PriorityQueue(Collection extends E> c) Creates a PriorityQueue containing the elements in the specified collection. | |
PriorityQueue(PriorityQueue extends E> c) Creates a PriorityQueue containing the elements in the specified priority queue. | |
PriorityQueue(SortedSet extends E> 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 super E> comparator) Creates a PriorityQueue with the specified initial capacity that orders its elements according to the specified comparator. |
boolean | add(E e) Inserts the specified element into this priority queue. |
void | clear() Removes all of the elements from this priority queue. |
boolean | contains(Object o) Returns true if this queue contains the specified element. |
Iterator | iterator() Returns an iterator over the elements in this queue. |
boolean | offer(E e) Inserts the specified element into this priority queue. |
E | peek() |
E | poll() |
boolean | remove(Object o) Removes a single instance of the specified element from this queue, if it is present. |
boolean | removeIf(Predicate super E> 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. |