Adds all elements provided by an iterator into the priority queue.
Adds all elements provided by an iterable into the priority queue.
Inserts a sequence as a single element into the priority queue.
Inserts a sequence as a single element into the priority queue. The given iterator has to produce elements in descending order!
Inserts a single element into the priority queue.
Removes all elements from the queue.
Removes all elements from the queue. After this operation is completed, the queue will be empty.
(Changed in version 2.8.0) collect
has changed. The previous behavior can be reproduced with toSeq
.
Returns the element with the highest priority in the queue, and removes this element from the queue.
Returns the element with the highest priority in the queue, and removes this element from the queue.
the element with the highest priority.
Adds all elements to the queue.
Adds all elements to the queue. The given iterators have to produce elements in descending order!
Adds all elements to the queue.
Returns the element with the highest priority in the queue, or throws an error if there is no element contained in the queue.
Returns the element with the highest priority in the queue, or throws an error if there is no element contained in the queue.
the element with the highest priority.
(Since version ) see corresponding Javadoc for more information.
Priority queue that can handle both single elements and pre-sorted sequences (iterators) of elements