changeset 7723:a6cbb9808e4b

6799426: Adds constructor PriorityQueue(Comparator) Reviewed-by: lancea
author mduigou
date Mon, 22 Jul 2013 12:59:09 -0700
parents a3a2889b1049
children 7716beb127d4 8156630c1ed3
files src/share/classes/java/util/PriorityQueue.java
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/PriorityQueue.java	Mon Jul 22 15:26:11 2013 +0100
+++ b/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.
      *