in scala.collection.mutable
class Queue

[scala.serializable, scala.cloneable]
`class` Queue [A]
  `extends` java.lang.Object
  `with` scala.collection.mutable.MutableList[A]
  `with` scala.ScalaObject

  `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

Direct Known Subclasses:
  SynchronizedQueue, QueueProxy

Constructor Summary
| `def` this

Def Summary
| `def` ++= (it: scala.Iterator[A]) : scala.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: scala.Iterable[A]) : scala.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) : scala.Unit Inserts a single element at the end of the queue.
| `def` clear : scala.Unit Removes all elements from the queue. After this operation is completed, the queue will be empty.
`override` | `def` clone : scala.collection.mutable.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: scala.Function1[A, scala.Boolean]) : scala.Seq[A] Returns all elements in the queue which satisfy the given predicate, and removes those elements from the queue.
| `def` dequeueFirst (p: scala.Function1[A, scala.Boolean]) : scala.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*) : scala.Unit Adds all elements to the queue.
`override` | `def` equals (that: scala.Any) : scala.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 : scala.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 : scala.Boolean Checks if the queue is empty.
`override` | `def` toString : java.lang.String Returns a textual representation of a queue as a string.

Constructor Detail

`def` this

Def Detail

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

`def` ++= (iter: scala.Iterable[A]): scala.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

`def` += (elem: A): scala.Unit

  Inserts a single element at the end of the queue.

Parameters:
  `elem -` the element to insert

`def` clear : scala.Unit

  Removes all elements from the queue. After this operation is completed, the queue will be empty.

`override def` clone : scala.collection.mutable.Queue[A]

  This method clones the queue.

Returns:
  a queue with the same elements.

`def` dequeue : A

  Returns the first element in the queue, and removes this element from the queue.

Throws:
  `java -` .util.NoSuchElementException
Returns:
  the first element of the queue.

`def` dequeueAll (p: scala.Function1[A, scala.Boolean]): scala.Seq[A]

  Returns all elements in the queue which satisfy the given predicate, and removes those elements from the queue.

Parameters:
  `p -` the predicate used for choosing elements
Returns:
  a sequence of all elements in the queue for which p yields true.

`def` dequeueFirst (p: scala.Function1[A, scala.Boolean]): scala.Option[A]

  Returns the first element in the queue which satisfies the given predicate, and removes this element from the queue.

Parameters:
  `p -` the predicate used for choosing the first element
Returns:
  the first element of the queue for which p yields true

`def` enqueue (elems: A*): scala.Unit

  Adds all elements to the queue.

Parameters:
  `elems -` the elements to add.

`override def` equals (that: scala.Any): scala.Boolean

  Checks if two queues are structurally identical.

Returns:
  true, iff both queues contain the same sequence of elements.

`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.

`override def` hashCode : scala.Int

  The hashCode method always yields an error, since it is not safe to use mutable queues as keys in hash tables.

Throws:
  `UnsupportedOperationException -`
Returns:
  never.

`override def` isEmpty : scala.Boolean

  Checks if the queue is empty.

Returns:
  true, iff there is no element in the queue.

`override def` toString : java.lang.String

  Returns a textual representation of a queue as a string.

Returns:
  the string representation of this queue.