Chunk

object Chunk
Companion:
class
trait StrictOptimizedSeqFactory[Chunk]
trait SeqFactory[Chunk]
trait IterableFactory[Chunk]
class Object
trait Matchable
class Any
Chunk.type

Type members

Classlikes

final case class AnyRefArray[A <: AnyRef](array: Array[A], offset: Int, length: Int) extends ChunkIterator[A]
object BitChunk
final case class BooleanArray(array: Array[Boolean], offset: Int, length: Int) extends ChunkIterator[Boolean]
final case class ByteArray(array: Array[Byte], offset: Int, length: Int) extends ChunkIterator[Byte]
final case class CharArray(array: Array[Char], offset: Int, length: Int) extends ChunkIterator[Char]
Companion:
class
sealed trait ChunkIterator[+A]

A ChunkIterator is a specialized iterator that supports efficient iteration over chunks. Unlike a normal iterator, the caller is responsible for providing an index with each call to hasNextAt and nextAt. By contract this should be 0 initially and incremented by 1 each time nextAt is called. This allows the caller to maintain the current index in local memory rather than the iterator having to do it on the heap for array backed chunks.

A ChunkIterator is a specialized iterator that supports efficient iteration over chunks. Unlike a normal iterator, the caller is responsible for providing an index with each call to hasNextAt and nextAt. By contract this should be 0 initially and incremented by 1 each time nextAt is called. This allows the caller to maintain the current index in local memory rather than the iterator having to do it on the heap for array backed chunks.

Companion:
object
final case class DoubleArray(array: Array[Double], offset: Int, length: Int) extends ChunkIterator[Double]
final case class FloatArray(array: Array[Float], offset: Int, length: Int) extends ChunkIterator[Float]
final case class IntArray(array: Array[Int], offset: Int, length: Int) extends ChunkIterator[Int]
object IsText
Companion:
class
sealed trait IsText[-T]
Companion:
object
final case class LongArray(array: Array[Long], offset: Int, length: Int) extends ChunkIterator[Long]
final case class ShortArray(array: Array[Short], offset: Int, length: Int) extends ChunkIterator[Short]

Value members

Concrete methods

override def apply[A](as: A*): Chunk[A]

Returns a chunk from a number of values.

Returns a chunk from a number of values.

Definition Classes
IterableFactory
override def empty[A]: Chunk[A]

Returns the empty chunk.

Returns the empty chunk.

Definition Classes
IterableFactory
override def fill[A](n: Int)(elem: => A): Chunk[A]
Definition Classes
StrictOptimizedSeqFactory -> IterableFactory
def fromArray[A](array: Array[A]): Chunk[A]

Returns a chunk backed by an array.

Returns a chunk backed by an array.

WARNING: The array must not be mutated after creating the chunk.

def fromByteBuffer(buffer: ByteBuffer): Chunk[Byte]

Returns a chunk backed by a java.nio.ByteBuffer.

Returns a chunk backed by a java.nio.ByteBuffer.

def fromCharBuffer(buffer: CharBuffer): Chunk[Char]

Returns a chunk backed by a java.nio.CharBuffer.

Returns a chunk backed by a java.nio.CharBuffer.

def fromDoubleBuffer(buffer: DoubleBuffer): Chunk[Double]

Returns a chunk backed by a java.nio.DoubleBuffer.

Returns a chunk backed by a java.nio.DoubleBuffer.

def fromFloatBuffer(buffer: FloatBuffer): Chunk[Float]

Returns a chunk backed by a java.nio.FloatBuffer.

Returns a chunk backed by a java.nio.FloatBuffer.

def fromIntBuffer(buffer: IntBuffer): Chunk[Int]

Returns a chunk backed by a java.nio.IntBuffer.

Returns a chunk backed by a java.nio.IntBuffer.

def fromIterable[A](it: Iterable[A]): Chunk[A]

Returns a chunk backed by an iterable.

Returns a chunk backed by an iterable.

def fromIterator[A](iterator: Iterator[A]): Chunk[A]

Creates a chunk from an iterator.

Creates a chunk from an iterator.

def fromJavaIterable[A](iterable: Iterable[A]): Chunk[A]

Returns a chunk backed by a Java iterable.

Returns a chunk backed by a Java iterable.

def fromJavaIterator[A](iterator: Iterator[A]): Chunk[A]

Creates a chunk from a Java iterator.

Creates a chunk from a Java iterator.

def fromLongBuffer(buffer: LongBuffer): Chunk[Long]

Returns a chunk backed by a java.nio.LongBuffer.

Returns a chunk backed by a java.nio.LongBuffer.

def fromShortBuffer(buffer: ShortBuffer): Chunk[Short]

Returns a chunk backed by a java.nio.ShortBuffer.

Returns a chunk backed by a java.nio.ShortBuffer.

def single[A](a: A): Chunk[A]

Returns a singleton chunk, eagerly evaluated.

Returns a singleton chunk, eagerly evaluated.

def succeed[A](a: A): Chunk[A]

Alias for Chunk.single.

Alias for Chunk.single.

def unfold[S, A](s: S)(f: S => Option[(A, S)]): Chunk[A]

Constructs a Chunk by repeatedly applying the function f as long as it returns Some.

Constructs a Chunk by repeatedly applying the function f as long as it returns Some.

def unfoldZIO[R, E, A, S](s: S)(f: S => ZIO[R, E, Option[(A, S)]])(implicit trace: Trace): ZIO[R, E, Chunk[A]]

Constructs a Chunk by repeatedly applying the effectual function f as long as it returns Some.

Constructs a Chunk by repeatedly applying the effectual function f as long as it returns Some.

Inherited methods

override def concat[A](xss: Iterable[A]*): CC[A]
Definition Classes
StrictOptimizedSeqFactory -> IterableFactory
Inherited from:
StrictOptimizedSeqFactory
def fill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: => A): CC[CC[CC[CC[CC[A]]]]]
Inherited from:
IterableFactory
def fill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: => A): CC[CC[CC[CC[A]]]]
Inherited from:
IterableFactory
def fill[A](n1: Int, n2: Int, n3: Int)(elem: => A): CC[CC[CC[A]]]
Inherited from:
IterableFactory
def fill[A](n1: Int, n2: Int)(elem: => A): CC[CC[A]]
Inherited from:
IterableFactory
final def from[A](source: IterableOnce[A]): Chunk[A]
Inherited from:
ChunkFactory (hidden)
def iterate[A](start: A, len: Int)(f: A => A): CC[A]
Inherited from:
IterableFactory
def range[A : Integral](start: A, end: A, step: A): CC[A]
Inherited from:
IterableFactory
def range[A : Integral](start: A, end: A): CC[A]
Inherited from:
IterableFactory
override def tabulate[A](n: Int)(f: Int => A): CC[A]
Definition Classes
StrictOptimizedSeqFactory -> IterableFactory
Inherited from:
StrictOptimizedSeqFactory
def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(f: (Int, Int, Int, Int, Int) => A): CC[CC[CC[CC[CC[A]]]]]
Inherited from:
IterableFactory
def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) => A): CC[CC[CC[CC[A]]]]
Inherited from:
IterableFactory
def tabulate[A](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) => A): CC[CC[CC[A]]]
Inherited from:
IterableFactory
def tabulate[A](n1: Int, n2: Int)(f: (Int, Int) => A): CC[CC[A]]
Inherited from:
IterableFactory
final def unapplySeq[A](x: Chunk[A]): UnapplySeqWrapper[A]
Inherited from:
SeqFactory

Concrete fields

val unit: Chunk[Unit]

The unit chunk

The unit chunk

Implicits

Inherited implicits

implicit def iterableFactory[A]: Factory[A, CC[A]]
Inherited from:
IterableFactory