提交 20bce577 编写于 作者: M mduigou

6799426: Adds constructor PriorityQueue(Comparator)

Reviewed-by: lancea
上级 382dffe3
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册