mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-19 14:55:17 +00:00
6799426: Adds constructor PriorityQueue(Comparator)
Reviewed-by: lancea
This commit is contained in:
parent
38008f1a21
commit
e27ee62c84
@ -135,6 +135,19 @@ public class PriorityQueue<E> extends AbstractQueue<E>
|
||||
this(initialCapacity, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code PriorityQueue} with the default initial capacity
|
||||
* that orders its elements according to the specified comparator.
|
||||
*
|
||||
* @param comparator the comparator that will be used to order this
|
||||
* priority queue. If {@code null}, the {@linkplain Comparable
|
||||
* natural ordering} of the elements will be used.
|
||||
* @since 1.8
|
||||
*/
|
||||
public PriorityQueue(Comparator<? super E> comparator) {
|
||||
this(DEFAULT_INITIAL_CAPACITY, comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code PriorityQueue} with the specified initial capacity
|
||||
* that orders its elements according to the specified comparator.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user