scala.collection.mutable

trait QueueProxy

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

trait QueueProxy[A]
extends Queue[A] with SeqProxy[A]
Queue objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.
Author
Matthias Zenger
Version
1.1, 03/05/2004
Values and Variables inherited from MutableList
first0, last0, len
Method Summary
override 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.
override 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.
override def += (elem : A) : Unit
Inserts a single element at the end of the queue.
override def apply (n : Int) : A
Access element number n.
override 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.
override def dequeue : A
Returns the first element in the queue, and removes this element from the queue.
override def elements : Iterator[A]
Returns an iterator over all elements on the queue.
override def enqueue (elems : A*) : Unit
Adds all elements to the queue.
override 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 isEmpty : Boolean
Checks if the queue is empty.
override def length : Int
Returns the length of this queue.
abstract def self : Queue[A]
Methods inherited from SeqProxy
concat, isDefinedAt, lastIndexOf, map, flatMap, filter, take, drop, takeWhile, dropWhile, reverse, contains, slice, 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 Queue
dequeueFirst, dequeueAll
Methods inherited from MutableList
get, prependElem, appendElem, reset, last, stringPrefix
Methods inherited from Seq
lengthCompare, size, lastOption, headOption, ++, subseq, projection, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Iterable
toStream, 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 : Queue[A]
Overrides
SeqProxy.self

override def apply(n : Int) : A
Access element number n.
Returns
the element at index n.
Overrides
SeqProxy.apply

override def length : Int
Returns the length of this 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
Queue.isEmpty, SeqProxy.isEmpty

override def +=(elem : A) : Unit
Inserts a single element at the end of the queue.
Parameters
elem - the element to insert
Overrides
Queue.+=

override 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.
Parameters
iter - an iterable object
Overrides
Queue.++=

override 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.
Parameters
iter - an iterator
Overrides
Queue.++=

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

override def dequeue : A
Returns the first element in the queue, and removes this element from the queue.
Returns
the first element of the queue.
Overrides
Queue.dequeue

override def front : A
Returns the first element in the queue, or throws an error if there is no element contained in the queue.
Returns
the first element.
Overrides
Queue.front

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

override def elements : Iterator[A]
Returns an iterator over all elements on the queue.
Returns
an iterator over all queue elements.

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