in scala.collection.immutable
class Queue

`class` Queue [ A ]
  `extends` java.lang.Object
  `with` scala.Seq[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:
  Erik Stenman
version:
  1.0, 08/07/2003

Constructor Summary
| `def` this ( elem : A* )

Def Summary
| `def` + [ A <: B ] ( elem : B ) : scala.collection.immutable.Queue[B] Creates a new queue with element added at the end of the old queue.
| `def` + [ A <: B ] ( iter : scala.Iterable[B] ) : scala.collection.immutable.Queue[B] Returns a new queue with all all elements provided by an `Iterable` object added at the end of the queue. The elements are prepended in the order they are given out by the iterator.
| `def` apply ( n : scala.Int ) : A Returns the `n`-th element of this queue. The first element is at position 0.
| `def` dequeue : scala.Tuple2[A,scala.collection.immutable.Queue[A]] Returns a tuple with the first element in the queue, and a new queue with this element removed.
| `def` elements : scala.Iterator[A] Returns the elements in the list as an iterator
| `def` enqueue [ A <: B ] ( elems : B* ) : scala.collection.immutable.Queue[B] Returns a new queue with all elements added.
`override` | `def` equals ( o : scala.Any ) : scala.Boolean Compares two queues for equality by comparing each element in the queues.
| `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
| `def` isEmpty : scala.Boolean Checks if the queue is empty.
| `def` length : scala.Int Returns the length of the queue.
`protected` | `def` mkQueue [ A ] ( i : scala.List[A] , o : scala.List[A] ) : scala.collection.immutable.Queue[A]
`override` | `def` toString : java.lang.String Returns a string representation of this queue.

Constructor Detail

`def` this ( elem : A* )

Def Detail

`def` + [ A <: B ]( elem : B ) : scala.collection.immutable.Queue[B]

  Creates a new queue with element added at the end of the old queue.

param:
  elem the element to insert

`def` + [ A <: B ]( iter : scala.Iterable[B] ) : scala.collection.immutable.Queue[B]

  Returns a new queue with all all elements provided by an `Iterable` object added at the end of the queue. The elements are prepended in the order they are given out by the iterator.

param:
  iter an iterable object

`def` apply ( n : scala.Int ) : A

  Returns the `n`-th element of this queue. The first element is at position 0.

param:
  n index of the element to return
return:
  the element at position `n` in this list.
throws:
  java.lang.RuntimeException if the list is too short.

`def` dequeue : scala.Tuple2[A,scala.collection.immutable.Queue[A]]

  Returns a tuple with the first element in the queue, and a new queue with this element removed.

return:
  the first element of the queue.

`def` elements : scala.Iterator[A]

  Returns the elements in the list as an iterator

`def` enqueue [ A <: B ]( elems : B* ) : scala.collection.immutable.Queue[B]

  Returns a new queue with all elements added.

param:
  elems the elements to add.

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

  Compares two queues for equality by comparing each element in the queues.

return:
  true, iff the two queues are structurally equal.

`def` front : A

  Returns the first element in the queue, or throws an error if there is no element contained in the queue.

return:
  the first element.

override `def` hashCode : scala.Int

`def` isEmpty : scala.Boolean

  Checks if the queue is empty.

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

`def` length : scala.Int

  Returns the length of the queue.

protected `def` mkQueue [ A ]( i : scala.List[A] , o : scala.List[A] ) : scala.collection.immutable.Queue[A]

override `def` toString : java.lang.String

  Returns a string representation of this queue.