6799426: Adds constructor PriorityQueue(Comparator)
authormduigou
Mon, 22 Jul 2013 12:59:09 -0700
changeset 19037 18aee3cc498f
parent 19036 7e9050510b51
child 19038 b232a1a962ba
child 19040 7b25fde2a4ed
6799426: Adds constructor PriorityQueue(Comparator) Reviewed-by: lancea
jdk/src/share/classes/java/util/PriorityQueue.java
--- a/jdk/src/share/classes/java/util/PriorityQueue.java	Mon Jul 22 15:26:11 2013 +0100
+++ b/jdk/src/share/classes/java/util/PriorityQueue.java	Mon Jul 22 12:59:09 2013 -0700
@@ -136,6 +136,19 @@
     }
 
     /**
+     * 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.
      *