scala.collection.mutable

class PriorityQueueProxy

[source: scala/collection/mutable/PriorityQueueProxy.scala]

abstract class PriorityQueueProxy[A](implicit view$1 : (A) => Ordered[A])
extends PriorityQueue[A] with SeqProxy[A]
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
Values and Variables inherited from ResizableArray
initialSize, array
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. After this operation is completed, the queue will be empty.
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 drop (from : Int) : RandomAccessSeq[A]
Returns this sequence without its n first elements If this sequence has less than n elements, the empty sequence is returned. (non-strict)
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.
abstract def self : PriorityQueue[A]
override def slice (from : Int, until : Int) : RandomAccessSeq[A]
A sub-sequence starting at index from and ending (non-inclusive) at index until (non-strict)
override def take (until : Int) : RandomAccessSeq[A]
Returns a sequence consisting only over the first n elements of this sequence, or else the whole sequence, if it has less than n elements. (non-strict)
override def toQueue : Queue[A]
Returns a regular queue containing the same elements.
Methods inherited from SeqProxy
apply, concat, isDefinedAt, lastIndexOf, map, flatMap, filter, takeWhile, dropWhile, reverse, contains, toArray, copyToArray
Methods inherited from IterableProxy
foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, sameElements, copyToBuffer, toList, mkString, addString
Methods inherited from Proxy
hashCode, equals, toString
Methods inherited from PriorityQueue
fixUp, fixDown, +, +=, +, ++, ++
Methods inherited from ResizableArray
size0, size0_=, reduceToSize, ensureSize, swap, copy
Methods inherited from RandomAccessSeq
projection, patch, ++, toStream, safeIs
Methods inherited from Seq
lengthCompare, size, last, lastOption, first, firstOption, headOption, slice, subseq, toSeq, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Collection
stringPrefix
Methods inherited from Iterable
partition, mkString, mkString, addString, hasDefiniteSize
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def self : PriorityQueue[A]
Overrides
SeqProxy.self

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

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

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

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

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

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

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

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.
Overrides
PriorityQueue.dequeue

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.
Overrides
PriorityQueue.max

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

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

override def take(until : Int) : RandomAccessSeq[A]
Returns a sequence consisting only over the first n elements of this sequence, or else the whole sequence, if it has less than n elements. (non-strict)
Parameters
n - the number of elements to take
Returns
a possibly projected sequence
Overrides
SeqProxy.take

override def drop(from : Int) : RandomAccessSeq[A]
Returns this sequence without its n first elements If this sequence has less than n elements, the empty sequence is returned. (non-strict)
Parameters
n - the number of elements to drop
Returns
the new sequence
Overrides
SeqProxy.drop

override def slice(from : Int, until : Int) : RandomAccessSeq[A]
A sub-sequence starting at index from and ending (non-inclusive) at index until (non-strict)
Parameters
from - The index of the first element of the slice
until - The index of the element following the slice
Throws
IndexOutOfBoundsException - if from < 0 or length < from + len
Overrides
SeqProxy.slice

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