in scala.collection.immutable
class Queue

[scala.serializable]

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*)



Val Summary
protected val in : scala.List[A]

protected val out : scala.List[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

override 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*)

Val Detail
protected val in : scala.List[A]

protected val out : scala.List[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.
Parameters:
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.
Parameters:
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.
Parameters:
n - index of the element to return
Returns:
the element at position n in this queue.
Throws:
scala - .compat.Platform.NoSuchElementException if the queue 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.
Throws:
scala - .compat.Platform.NoSuchElementException
Returns:
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.
Parameters:
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.
Returns:
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.
Throws:
scala - .compat.Platform.NoSuchElementException
Returns:
the first element.

override def hashCode : scala.Int

override def isEmpty : scala.Boolean
Checks if the queue is empty.
Returns:
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.