Queue

final class Queue[A]
A FIFO queue of chunks that provides an O(1) size method and provides the ability to
take and drop individual elements while preserving the chunk structure as much as possible.
This is similar to a queue of individual elements but chunk structure is maintained.
Companion
object
class Object
trait Matchable
class Any

Value members

Methods

def isEmpty: Boolean
def nonEmpty: Boolean
def iterator: Iterator[A]
def +:(c: Chunk[A]): Queue[A]
Prepends a chunk to the start of this chunk queue.
def :+(c: Chunk[A]): Queue[A]
Appends a chunk to the end of this chunk queue.
def startsWith(seq: Seq[A]): Boolean
check to see if this starts with the items in the given seq
should be the same as take(seq.size).toChunk == Chunk.seq(seq)
def take(n: Int): Queue[A]
Takes the first n elements of this chunk queue in a way that preserves chunk structure.
def takeRight(n: Int): Queue[A]
Takes the right-most n elements of this chunk queue in a way that preserves chunk structure.
def drop(n: Int): Queue[A]
Drops the first n elements of this chunk queue in a way that preserves chunk structure.
def dropRight(n: Int): Queue[A]
Drops the right-most n elements of this chunk queue in a way that preserves chunk structure.
def toChunk: Chunk[A]
Converts this chunk queue to a single chunk, copying all chunks to a single chunk.
override def equals(that: Any): Boolean
Definition Classes
Any
override def hashCode: Int
Definition Classes
Any
override def toString: String
Definition Classes
Any

Fields

val chunks: Queue[Chunk[A]]
val size: Int