From 6826a04c7d7ecb158ee92a267558dc261b233e00 Mon Sep 17 00:00:00 2001 From: Rex Kerr Date: Tue, 30 Sep 2014 12:57:25 -0700 Subject: SI-8624 PriorityQueue documentation is not clear enough Added a paragraph explaining that dequeue is the only way to get your elements in priority order. --- src/library/scala/collection/mutable/PriorityQueue.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala index b949bec48a..a6e538528a 100644 --- a/src/library/scala/collection/mutable/PriorityQueue.scala +++ b/src/library/scala/collection/mutable/PriorityQueue.scala @@ -16,6 +16,11 @@ import generic._ * To prioritize elements of type A there must be an implicit * Ordering[A] available at creation. * + * Only the `dequeue` and `dequeueAll` methods will return methods in priority + * order (while removing elements from the heap). Standard collection methods + * including `drop` and `iterator` will remove or traverse the heap in whichever + * order seems most convenient. + * * @tparam A type of the elements in this priority queue. * @param ord implicit ordering used to compare the elements of type `A`. * -- cgit v1.2.3