sealed abstract
class
Dequeue[A] extends AnyRef
Abstract Value Members
-
abstract
def
backMaybe: Maybe[A]
-
abstract
def
frontMaybe: Maybe[A]
-
abstract
def
isEmpty: Boolean
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
def
+:(a: A): Dequeue[A]
-
def
:+(a: A): Dequeue[A]
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
cons(a: A): Dequeue[A]
-
-
-
def
finalize(): Unit
-
def
foldLeft[B](b: B)(f: (B, A) ⇒ B): B
-
def
foldRight[B](b: B)(f: (A, B) ⇒ B): B
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
def
map[B](f: (A) ⇒ B): Dequeue[B]
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
reverse: Dequeue[A]
-
def
size: Int
-
def
snoc(a: A): Dequeue[A]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toBackIList: IList[A]
-
def
toBackStream: Stream[A]
-
def
toIList: IList[A]
-
def
toStream: Stream[A]
-
def
toString(): String
-
-
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
A Double-ended queue, based on the Bankers Double Ended Queue as described by C. Okasaki in "Purely Functional Data Structures"
A queue that allows items to be put onto either the front (cons) or the back (snoc) of the queue in constant time, and constant time access to the element at the very front or the very back of the queue. Dequeueing an element from either end is constant time when amortized over a number of dequeues.
This queue maintains an invariant that whenever there are at least two elements in the queue, neither the front list nor back list are empty. In order to maintain this invariant, a dequeue from either side which would leave that side empty constructs the resulting queue by taking elements from the opposite side