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.

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

Concrete methods

def +:(c: Chunk[A]): Queue[A]

Prepends a chunk to the start of this chunk queue.

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.

Appends a chunk to the end of this chunk queue.

def drop(n: Int): Queue[A]

Drops the first n elements of this chunk queue in a way that preserves chunk structure.

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.

Drops the right-most n elements of this chunk queue in a way that preserves chunk structure.

override def equals(that: Any): Boolean
Definition Classes
Any
override def hashCode: Int
Definition Classes
Any
def isEmpty: Boolean
def iterator: Iterator[A]
def nonEmpty: Boolean
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)

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.

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.

Takes 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.

Converts this chunk queue to a single chunk, copying all chunks to a single chunk.

override def toString: String
Definition Classes
Any

Concrete fields

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