sealed abstract class Dequeue[A] extends AnyRef
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
- Source
- Dequeue.scala
- Alphabetic
- By Inheritance
- Dequeue
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def ++(other: Dequeue[A]): Dequeue[A]
Append another Dequeue to this dequeue
- def +:(a: A): Dequeue[A]
alias for cons
- def :+(a: A): Dequeue[A]
alias for snoc
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def cons(a: A): Dequeue[A]
enqueue to the front of the queue
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def foldLeft[B](b: B)(f: (B, A) => B): B
- def foldRight[B](b: B)(f: (A, B) => B): B
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B): Dequeue[B]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def reverse: Dequeue[A]
- def size: Int
- def snoc(a: A): Dequeue[A]
enqueue on to the back of the queue
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toBackIList: IList[A]
convert this queue to a list of elements from back to front
- def toBackLazyList: LazyList[A]
convert this queue to a LazyList of elements from back to front
- def toIList: IList[A]
convert this queue to a list of elements from front to back
- def toLazyList: LazyList[A]
convert this queue to a LazyList of elements from front to back
- def toString(): String
- Definition Classes
- AnyRef → Any
- def uncons: Maybe[(A, Dequeue[A])]
dequeue from the front of the queue
- def unsnoc: Maybe[(A, Dequeue[A])]
dequeue from the back of the queue
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()