6799426: Adds constructor PriorityQueue(Comparator)

Reviewed-by: lancea
This commit is contained in:
Mike Duigou 2013-07-22 12:59:09 -07:00
parent 38008f1a21
commit e27ee62c84

View File

@ -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.