in scala/collection/mutable
class PriorityQueueProxy

class PriorityQueueProxy[A](view: (A) => Ordered[A])
extends PriorityQueue[A]
with ScalaObject
with IterableProxy[A]

This class implements priority queues using a heap. The elements of the queue have to be ordered in terms of the Ordered[T] trait.
Author:
Matthias Zenger
Version:
1.0, 03/05/2004

Method Summary
override def ++=(iter: Iterable[A]): Unit
     Adds all elements provided by an Iterable object into the priority queue.
override def ++=(it: Iterator[A]): Unit
     Adds all elements provided by an iterator into the priority queue.
override def +=(elem: A): Unit
     Inserts a single element into the priority queue.
override def clear: Unit
     Removes all elements from the queue.
override def clone(): PriorityQueue[A]
     This method clones the priority queue.
override def dequeue: A
     Returns the element with the highest priority in the queue, and removes this element from the queue.
override def elements: Iterator[A]
     Creates a new iterator over all elements contained in this object.
override def enqueue(elems: A*): Unit
     Adds all elements to the queue.
override def isEmpty: Boolean
     Checks if the queue is empty.
override def length: Int
     Returns the length of this priority queue.
override 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.
override def toQueue: Queue[A]
     Returns a regular queue containing the same elements.

Methods inherited from java/lang/Object-class
eq, finalize, getClass, notify, notifyAll, synchronized, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/IterableProxy-class
/:, :\, exists, find, foldLeft, foldRight, forall, foreach, sameElements

Methods inherited from scala/Proxy-class
equals, hashCode, toString

Methods inherited from scala/collection/mutable/PriorityQueue-class
fixDown, fixUp, toList

Methods inherited from scala/collection/mutable/ResizableArray-class
array, copy, ensureSize, initialSize, size, swap

Method Detail

elements

  override def elements: Iterator[A]
Creates a new iterator over all elements contained in this object.
Returns:
the new iterator

length

  override def length: Int
Returns the length of this priority queue.

isEmpty

  override def isEmpty: Boolean
Checks if the queue is empty.
Returns:
true, iff there is no element in the queue.

+=

  override def +=(elem: A): Unit
Inserts a single element into the priority queue.
Parameters:
elem - the element to insert

++=

  override def ++=(iter: Iterable[A]): Unit
Adds all elements provided by an Iterable object into the priority queue.
Parameters:
iter - an iterable object

++=

  override def ++=(it: Iterator[A]): Unit
Adds all elements provided by an iterator into the priority queue.
Parameters:
it - an iterator

enqueue

  override def enqueue(elems: A*): Unit
Adds all elements to the queue.
Parameters:
elems - the elements to add.

dequeue

  override def dequeue: A
Returns the element with the highest priority in the queue, and removes this element from the queue.
Returns:
the element with the highest priority.

max

  override 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.

clear

  override def clear: Unit
Removes all elements from the queue. After this operation is completed, the queue will be empty.

toQueue

  override def toQueue: Queue[A]
Returns a regular queue containing the same elements.

clone

  override def clone(): PriorityQueue[A]
This method clones the priority queue.
Returns:
a priority queue with the same elements.