Packages

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
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Dequeue
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def backMaybe: Maybe[A]
  2. abstract def frontMaybe: Maybe[A]
  3. abstract def isEmpty: Boolean

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++(other: Dequeue[A]): Dequeue[A]

    Append another Dequeue to this dequeue

  4. def +:(a: A): Dequeue[A]

    alias for cons

  5. def :+(a: A): Dequeue[A]

    alias for snoc

  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def cons(a: A): Dequeue[A]

    enqueue to the front of the queue

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. def foldLeft[B](b: B)(f: (B, A) => B): B
  14. def foldRight[B](b: B)(f: (A, B) => B): B
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def map[B](f: (A) => B): Dequeue[B]
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def reverse: Dequeue[A]
  23. def size: Int
  24. def snoc(a: A): Dequeue[A]

    enqueue on to the back of the queue

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toBackIList: IList[A]

    convert this queue to a list of elements from back to front

  27. def toBackStream: Stream[A]

    convert this queue to a stream of elements from back to front

  28. def toIList: IList[A]

    convert this queue to a list of elements from front to back

  29. def toStream: Stream[A]

    convert this queue to a stream of elements from front to back

  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. def uncons: Maybe[(A, Dequeue[A])]

    dequeue from the front of the queue

  32. def unsnoc: Maybe[(A, Dequeue[A])]

    dequeue from the back of the queue

  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped