in scala.collection.mutable
class PriorityQueue

[scala.serializable, scala.cloneable]
`class` PriorityQueue [A]
  `extends` java.lang.Object
  `with` scala.collection.mutable.ResizableArray[A]
  `with` scala.ScalaObject

  This class implements priority queues using a heap. The elements of the queue have to be ordered in terms of the `Ordered[T]` class.

Author:
  Matthias Zenger
Version:
  1.0, 03/05/2004

Direct Known Subclasses:
  SynchronizedPriorityQueue, PriorityQueueProxy

Constructor Summary
| `def` this ()(view$0: (A) => scala.Ordered[A])

Val inherited from scala.collection.mutable.ResizableArray[A]
initialSize

Var inherited from scala.collection.mutable.ResizableArray[A]
array , size

Def Summary
| `def` + (elem1: A, elem2: A, elems: A*) : scala.collection.mutable.PriorityQueue[A]
| `def` + (elem: A) : scala.collection.mutable.PriorityQueue[A]
| `def` ++ (iter: scala.Iterable[A]) : scala.collection.mutable.PriorityQueue[A]
| `def` ++ (iter: scala.Iterator[A]) : scala.collection.mutable.PriorityQueue[A]
| `def` ++= (it: scala.Iterator[A]) : scala.Unit Adds all elements provided by an iterator into the priority queue.
| `def` ++= (iter: scala.Iterable[A]) : scala.Unit Adds all elements provided by an `Iterable` object into the priority queue.
| `def` += (elem1: A, elem2: A, elems: A*) : scala.Unit Add two or more elements to this set.
| `def` += (elem: A) : scala.Unit Inserts a single element into the priority queue.
| `def` clear : scala.Unit Removes all elements from the queue. After this operation is completed, the queue will be empty.
`override` | `def` clone : scala.collection.mutable.PriorityQueue[A] This method clones the priority queue.
| `def` dequeue : A Returns the element with the highest priority in the queue, and removes this element from the queue.
`override` | `def` elements : scala.Iterator[A] Returns an iterator which yiels all the elements of the priority queue in descending priority order.
| `def` enqueue (elems: A*) : scala.Unit Adds all elements to the queue.
`override` | `def` equals (that: scala.Any) : scala.Boolean Checks if two queues are structurally identical.
`protected` | `def` fixDown (as: scala.Array[A], m: scala.Int, n: scala.Int) : scala.Unit
`protected` | `def` fixUp (as: scala.Array[A], m: scala.Int) : scala.Unit
`override` | `def` hashCode : scala.Int The hashCode method always yields an error, since it is not safe to use mutable queues as keys in hash tables.
`override` | `def` isEmpty : scala.Boolean Checks if the queue is empty.
| `def` max : A Returns the element with the highest priority in the queue, or throws an error if there is no element contained in the queue.
| `def` toQueue : scala.collection.mutable.Queue[A] Returns a regular queue containing the same elements.
`override` | `def` toString : java.lang.String Returns a textual representation of a queue as a string.

Def inherited from scala.collection.mutable.ResizableArray[A]
apply , copy, copyToArray, copyToBuffer, elements, ensureSize, length, swap

Constructor Detail

`def` this ()(view$0: (A) => scala.Ordered[A])

Def Detail

`def` + (elem1: A, elem2: A, elems: A*): scala.collection.mutable.PriorityQueue[A]

`def` + (elem: A): scala.collection.mutable.PriorityQueue[A]

`def` ++ (iter: scala.Iterable[A]): scala.collection.mutable.PriorityQueue[A]

`def` ++ (iter: scala.Iterator[A]): scala.collection.mutable.PriorityQueue[A]

`def` ++= (it: scala.Iterator[A]): scala.Unit

  Adds all elements provided by an iterator into the priority queue.

Parameters:
  `it -` an iterator

`def` ++= (iter: scala.Iterable[A]): scala.Unit

  Adds all elements provided by an `Iterable` object into the priority queue.

Parameters:
  `iter -` an iterable object

`def` += (elem1: A, elem2: A, elems: A*): scala.Unit

  Add two or more elements to this set.

Parameters:
  `elem1 -` the first element.
Parameters:
  `kv2 -` the second element.
Parameters:
  `kvs -` the remaining elements.

`def` += (elem: A): scala.Unit

  Inserts a single element into the priority queue.

Parameters:
  `elem -` the element to insert

`def` clear : scala.Unit

  Removes all elements from the queue. After this operation is completed, the queue will be empty.

`override def` clone : scala.collection.mutable.PriorityQueue[A]

  This method clones the priority queue.

Returns:
  a priority queue with the same elements.

`def` dequeue : A

  Returns the element with the highest priority in the queue, and removes this element from the queue.

Throws:
  `Predef.NoSuchElementException -`
Returns:
  the element with the highest priority.

`override def` elements : scala.Iterator[A]

  Returns an iterator which yiels all the elements of the priority queue in descending priority order.

Returns:
  an iterator over all elements sorted in descending order.

`def` enqueue (elems: A*): scala.Unit

  Adds all elements to the queue.

Parameters:
  `elems -` the elements to add.

`override def` equals (that: scala.Any): scala.Boolean

  Checks if two queues are structurally identical.

Returns:
  true, iff both queues contain the same sequence of elements.

`protected def` fixDown (as: scala.Array[A], m: scala.Int, n: scala.Int): scala.Unit

`protected def` fixUp (as: scala.Array[A], m: scala.Int): scala.Unit

`override def` hashCode : scala.Int

  The hashCode method always yields an error, since it is not safe to use mutable queues as keys in hash tables.

Returns:
  never.

`override def` isEmpty : scala.Boolean

  Checks if the queue is empty.

Returns:
  true, iff there is no element in the queue.

`def` max : A

  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.

`def` toQueue : scala.collection.mutable.Queue[A]

  Returns a regular queue containing the same elements.

`override def` toString : java.lang.String

  Returns a textual representation of a queue as a string.

Returns:
  the string representation of this queue.