|
Scala 2
|
class
Queue
[ A ]
extends
java.lang.Object with
scala.Seq[A] with
scala.ScalaObjectQueue
objects implement data structures that allow to
insert and retrieve elements in a first-in-first-out (FIFO) manner.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]
def
+
[ A <: B ]( iter : scala.Iterable[B] ) : scala.collection.immutable.Queue[B]
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
n
-th element of this queue.
The first element is at position 0.n
in this list.def
dequeue
: scala.Tuple2[A,scala.collection.immutable.Queue[A]]
def
elements
: scala.Iterator[A]
def
enqueue
[ A <: B ]( elems : B* ) : scala.collection.immutable.Queue[B]
def
equals
( o : scala.Any ) : scala.Boolean
def
front
: A
def
hashCode
: scala.Int
def
isEmpty
: scala.Boolean
def
length
: scala.Int
def
mkQueue
[ A ]( i : scala.List[A] , o : scala.List[A] ) : scala.collection.immutable.Queue[A]
def
toString
: java.lang.String