|
Scala Library
|
|
class
PriorityQueue[A](implicit ord : Ordering[A])
extends ResizableArray[A] with Addable[A, PriorityQueue[A]] with Growable[A] with Cloneable[PriorityQueue[A]]| Values and Variables inherited from ResizableArray | |
| array, size0 |
| Method Summary | |
override def
|
+
(elem1 : A, elem2 : A, elems : A*) : PriorityQueue[A]
Add two or more elements to this set.
|
def
|
+
(elem : A) : PriorityQueue[A]
Creates a new collection with an additional element, unless the element is already present.
|
override def
|
++
(iter : Iterator[A]) : PriorityQueue[A]
Adds all elements provided by an iterator into the priority queue.
|
override def
|
++
(elems : Traversable[A]) : PriorityQueue[A]
Adds all elements provided by an
Iterable object
into the priority queue. |
def
|
+=
(elem : A) : PriorityQueue[A]
Inserts a single element into the priority queue.
|
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.
|
def
|
dequeue
: A
Returns the element with the highest priority in the queue,
and removes this element from the queue.
|
def
|
enqueue
(elems : A*) : Unit
Adds all elements to the queue.
|
override def
|
equals
(obj : Any) : Boolean
This is utterly broken: Two priority queues of different length can still be equal!
The method should be removed once PriotyQueue inserts correctly into the sequence class hierarchy.
|
protected def
|
fixDown (as : Array[AnyRef], m : Int, n : Int) : Unit |
protected def
|
fixUp (as : Array[AnyRef], m : Int) : Unit |
override def
|
foreach
[U](f : (A) => U) : Unit
Apply a function
f to all elements of this
iterable object. |
override def
|
hashCode
: 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
: Boolean
Does this iterable contain no elements?
|
override def
|
iterator
: Iterator[A]
Returns an iterator which yields all the elements of the priority
queue in descending priority order.
|
override def
|
length
: Int
Returns the length of this resizable array.
|
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
|
repr : PriorityQueue[A] |
override def
|
toList
: List[A]
Returns a list with all elements of this traversable object.
|
def
|
toQueue
: 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.
|
| Methods inherited from Growable | |
| +=, ++=, ++= |
| Methods inherited from ResizableArray | |
| companion, initialSize, apply, update, copyToArray, reduceToSize, ensureSize, swap, copy |
| Methods inherited from IndexedSeqLike | |
| thisCollection, toCollection, view, view |
| Methods inherited from IndexedSeqLike | |
| forall, exists, find, foldLeft, foldRight, reduceLeft, reduceRight, zip, zipWithIndex, slice, head, tail, last, init, take, drop, takeRight, dropRight, splitAt, takeWhile, dropWhile, span, sameElements, lengthCompare, segmentLength, indexWhere, lastIndexWhere, reverse, reverseIterator, startsWith, endsWith |
| Methods inherited from SeqLike | |
| size, isDefinedAt, prefixLength, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, reverseMap, reversedElements, startsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, updated, +:, :+, padTo, sortWith, sortWith, sortBy, toSeq, indices, findLastIndexOf, equalsWith, containsSlice, projection |
| Methods inherited from PartialFunction | |
| orElse, andThen |
| Methods inherited from Function1 | |
| compose |
| Methods inherited from IterableLike | |
| elements, toIterable, zipAll, toStream, canEqual, first, firstOption |
| Methods inherited from GenericTraversableTemplate | |
| newBuilder, genericBuilder, unzip, flatten, transpose |
| Methods inherited from TraversableLike | |
| nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, /:, :\, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, lastOption, copyToBuffer, copyToArray, toArray, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix, withFilter |
| Methods inherited from AnyRef | |
| getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
| Methods inherited from Any | |
| ==, !=, isInstanceOf, asInstanceOf |
| Method Details |
override
def
length : Int
override
def
isEmpty : Boolean
override
def
repr : PriorityQueue[A]
f to all elements of this
iterable object.f - A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.
def
+=(elem : A) : PriorityQueue[A]
elem - the element to insert
def
+(elem : A) : PriorityQueue[A]
elem - the element to be addedoverride
def
+(elem1 : A, elem2 : A, elems : A*) : PriorityQueue[A]
elem1 - the first element.kv2 - the second element.kvs - the remaining elements.override
def
++(elems : Traversable[A]) : PriorityQueue[A]
Iterable object
into the priority queue.iter - an iterable objectoverride
def
++(iter : Iterator[A]) : PriorityQueue[A]
it - an iteratorelems - the elements to add.
def
dequeue : A
def
max : A
def
clear : Unit
override
def
hashCode : Int
override
def
toString : java.lang.String
override
def
clone : PriorityQueue[A]
|
Scala Library
|
|