scala.collection.mutable

class SynchronizedQueue

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

class SynchronizedQueue[A]
extends Queue[A]
This is a synchronized version of the Queue[T] class. It implements a data structure that allows one to insert and retrieve elements in a first-in-first-out (FIFO) manner.
Author
Matthias Zenger
Version
1.0, 03/05/2004
Since
1
Values and Variables inherited from MutableList
first0, last0, len
Method Summary
override def ++= (iter : Traversable[A]) : SynchronizedQueue[A]
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]) : SynchronizedQueue[A]
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) : SynchronizedQueue[A]
Inserts a single element at the end of the queue.
override def clear : Unit
Removes all elements from the queue. After this operation is completed, the queue will be empty.
override def dequeue : A
Returns the first element in the queue, and removes this element from the queue.
override def enqueue (elems : A*) : Unit
Adds all elements to the queue.
override def equals (that : Any) : Boolean
Checks if two queues are structurally identical.
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 toString : java.lang.String
Returns a textual representation of a queue as a string.
Methods inherited from Queue
dequeueFirst, dequeueAll, extractFirst
Methods inherited from Cloneable
clone
Methods inherited from MutableList
newBuilder, head, tail, length, apply, update, get, prependElem, appendElem, reset, iterator, last, toList, result
Methods inherited from Builder
sizeHint, mapResult
Methods inherited from Growable
+=
Methods inherited from LinearSeq
companion
Methods inherited from LinearSeqLike
thisCollection, toCollection, foreach, forall, exists, count, find, foldLeft, foldRight, reduceLeft, reduceRight, take, drop, dropRight, slice, takeWhile, span, sameElements, lengthCompare, isDefinedAt, segmentLength, indexWhere, lastIndexWhere
Methods inherited from SeqLike
size, prefixLength, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, reverse, reverseMap, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, updated, +:, :+, padTo, sortWith, sortWith, sortBy, toSeq, indices, view, view, hashCode, findLastIndexOf, equalsWith, containsSlice, projection
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from IterableLike
elements, toIterable, takeRight, copyToArray, zip, zipAll, zipWithIndex, toStream, canEqual, first, firstOption
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, /:, :\, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, lastOption, init, dropWhile, splitAt, 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 isEmpty : Boolean
Checks if the queue is empty.
Returns
true, iff there is no element in the queue.

override def +=(elem : A) : SynchronizedQueue[A]
Inserts a single element at the end of the queue.
Parameters
elem - the element to insert

override def ++=(iter : Traversable[A]) : SynchronizedQueue[A]
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

override def ++=(it : Iterator[A]) : SynchronizedQueue[A]
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
it - an iterator

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.

override def equals(that : Any) : Boolean
Checks if two queues are structurally identical.
Returns
true, iff both queues contain the same sequence of elements.

override def toString : java.lang.String
Returns a textual representation of a queue as a string.
Returns
the string representation of this queue.