|
Scala Library
|
|
scala/collection/mutable/Queue.scala]
class
Queue[A]
extends MutableList[A] with CloneableCollectionQueue objects implement data structures that allow to
insert and retrieve elements in a first-in-first-out (FIFO) manner.| Values and Variables inherited from MutableList | |
| first0, last0, len |
| Method Summary | |
def
|
++=
(it : Iterator[A]) : Unit
Adds all elements provided by an iterator
at the end of the queue. The elements are prepended in the order they
are given out by the iterator.
|
def
|
++=
(iter : Iterable[A]) : Unit
Adds all elements provided by an
Iterable object
at the end of the queue. The elements are prepended in the order they
are given out by the iterator. |
def
|
+=
(elem : A) : Unit
Inserts a single element at the end of the queue.
|
def
|
clear
: Unit
Removes all elements from the queue. After this operation is completed,
the queue will be empty.
|
override def
|
clone
: Queue[A]
This method clones the queue.
|
def
|
dequeue
: A
Returns the first element in the queue, and removes this element
from the queue.
|
def
|
dequeueAll
(p : (A) => Boolean) : Seq[A]
Returns all elements in the queue which satisfy the
given predicate, and removes those elements from the queue.
|
def
|
dequeueFirst
(p : (A) => Boolean) : Option[A]
Returns the first element in the queue which satisfies the
given predicate, and removes this element from the queue.
|
def
|
enqueue
(elems : A*) : Unit
Adds all elements to the queue.
|
override def
|
equals
(obj : Any) : Boolean
Checks if two queues are structurally identical.
|
def
|
front
: A
Returns the first element in the queue, or throws an error if there
is no element contained in the queue.
|
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
Checks if the queue is empty.
|
override def
|
toString
: java.lang.String
Returns a textual representation of a queue as a string.
|
| Methods inherited from MutableList | |
| length, apply, get, prependElem, appendElem, reset, elements, last, toList, stringPrefix |
| Methods inherited from Seq | |
| lengthCompare, size, concat, lastOption, first, firstOption, headOption, ++, isDefinedAt, lastIndexOf, findIndexOf, indexOf, map, flatMap, filter, take, drop, slice, slice, takeWhile, dropWhile, reverse, contains, subseq, toArray, toSeq, projection, equalsWith, startsWith, startsWith, endsWith, indexOf, containsSlice |
| Methods inherited from Iterable | |
| partition, foreach, forall, exists, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, 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 |
override
def
isEmpty : Boolean
elem - the element to insertIterable object
at the end of the queue. The elements are prepended in the order they
are given out by the iterator.iter - an iterable objectit - an iteratorelems - the elements to add.
def
dequeue : A
p - the predicate used for choosing the first elementp - the predicate used for choosing elements
def
front : A
def
clear : Unit
override
def
hashCode : Int
override
def
toString : java.lang.String
|
Scala Library
|
|