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.
- Alphabetic
- By Inheritance
- LazyStackQueue
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
enqueue(a: A): Unit
Enqueues an element on bottom.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filterPop(predicate: (A) ⇒ Boolean, n: Int): List[A]
Pops until having obtained n elements satisfying the predicate (or fewer if exhausted).
-
def
filterPop(predicate: (A) ⇒ Boolean): Option[A]
Pops until finding an element satisfying the given predicate, and returns it (or None if exhausted).
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
numManuallyEnqueued: Int
Returns the total number of elements in the component queues, not counting those buffered from the source iterator.
-
def
pop(n: Int): List[A]
Pops n elements from the top (or fewer if exhausted).
-
def
pop: Option[A]
Pops an element from the top.
-
def
push(a: A): Unit
Pushes an element on top.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )