Packages

c

spacro.util

LazyStackQueue

class LazyStackQueue[A] extends AnyRef

A mutable data structure based on the following operations: push: adds to the top pop: takes from the top enqueue: adds to the bottom The other main feature is that you instantiate it with an Iterator of starting items, which it only traverses as necessary, buffering up to maxBufferSize elements at a time. Note that items enqueued into the LazyStackQueue will only be popped off after the source iterator is empty. LazyStackQueue should be viewed as "consuming" the iterator---you should not use the iterator again after passing it into the constructor.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LazyStackQueue
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LazyStackQueue(source: Iterator[A], maxBufferSize: Int = 10)

    makes a LazyStackQueue

    makes a LazyStackQueue

    source

    the initial elements of the queue to be lazily loaded as demanded

    maxBufferSize

    the max number of elements to buffer from the source

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def enqueue(a: A): Unit

    Enqueues an element on bottom.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def filterPop(predicate: (A) ⇒ Boolean, n: Int): List[A]

    Pops until having obtained n elements satisfying the predicate (or fewer if exhausted).

  10. def filterPop(predicate: (A) ⇒ Boolean): Option[A]

    Pops until finding an element satisfying the given predicate, and returns it (or None if exhausted).

  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. def numManuallyEnqueued: Int

    Returns the total number of elements in the component queues, not counting those buffered from the source iterator.

  19. def pop(n: Int): List[A]

    Pops n elements from the top (or fewer if exhausted).

  20. def pop: Option[A]

    Pops an element from the top.

  21. def push(a: A): Unit

    Pushes an element on top.

  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped