Chunk

zio.blocks.chunk.Chunk
See theChunk companion class
object Chunk

Attributes

Companion
class
Source
Chunk.scala
Graph
Supertypes
trait StrictOptimizedSeqFactory[Chunk]
trait SeqFactory[Chunk]
trait IterableFactory[Chunk]
trait Pure
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
Chunk.type

Members list

Type members

Classlikes

object BitChunk

Attributes

Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BitChunk.type
object ChunkIterator

Attributes

Companion
trait
Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any
Self type
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.

Attributes

Companion
object
Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object IsText

Attributes

Companion
trait
Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any
Self type
IsText.type
sealed trait IsText[-T]

Attributes

Companion
object
Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any

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.

Attributes

Definition Classes
IterableFactory
Source
Chunk.scala
override def empty[A]: Chunk[A]

Returns the empty chunk.

Returns the empty chunk.

Attributes

Definition Classes
IterableFactory
Source
Chunk.scala
override def fill[A](n: Int)(elem: => A): Chunk[A]

Creates a new Chunk by producing n copies of a value generated from the given expression.

Creates a new Chunk by producing n copies of a value generated from the given expression.

Attributes

Definition Classes
StrictOptimizedSeqFactory -> IterableFactory
Source
Chunk.scala
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. If you're unsure whether the array will be mutated, prefer Chunk.fromIterable or Chunk.from which create a copy of the provided array.

Attributes

Source
Chunk.scala
def fromByteBuffer(buffer: ByteBuffer): Chunk[Byte]

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

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

Attributes

Source
Chunk.scala
def fromCharBuffer(buffer: CharBuffer): Chunk[Char]

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

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

Attributes

Source
Chunk.scala
def fromDoubleBuffer(buffer: DoubleBuffer): Chunk[Double]

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

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

Attributes

Source
Chunk.scala
def fromFloatBuffer(buffer: FloatBuffer): Chunk[Float]

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

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

Attributes

Source
Chunk.scala
def fromIntBuffer(buffer: IntBuffer): Chunk[Int]

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

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

Attributes

Source
Chunk.scala
def fromIterable[A](it: Iterable[A]): Chunk[A]

Returns a chunk backed by an iterable.

Returns a chunk backed by an iterable.

Attributes

Source
Chunk.scala
def fromIterator[A](iterator: Iterator[A]): Chunk[A]

Creates a chunk from an iterator.

Creates a chunk from an iterator.

Attributes

Source
Chunk.scala
def fromJavaIterable[A](iterable: Iterable[A]): Chunk[A]

Returns a chunk backed by a Java iterable.

Returns a chunk backed by a Java iterable.

Attributes

Source
Chunk.scala
def fromJavaIterator[A](iterator: Iterator[A]): Chunk[A]

Creates a chunk from a Java iterator.

Creates a chunk from a Java iterator.

Attributes

Source
Chunk.scala
def fromLongBuffer(buffer: LongBuffer): Chunk[Long]

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

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

Attributes

Source
Chunk.scala
def fromShortBuffer(buffer: ShortBuffer): Chunk[Short]

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

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

Attributes

Source
Chunk.scala
override def iterate[A](start: A, len: Int)(f: A => A): Chunk[A]

Iterates a function over a starting value a specified number of times, producing a chunk of results.

Iterates a function over a starting value a specified number of times, producing a chunk of results.

Attributes

Definition Classes
IterableFactory
Source
Chunk.scala

Creates a new instance of ChunkBuilder, which is a mutable builder for constructing chunks of elements.

Creates a new instance of ChunkBuilder, which is a mutable builder for constructing chunks of elements.

Attributes

Source
Chunk.scala
def single[A](a: A): Chunk[A]

Returns a singleton chunk, eagerly evaluated.

Returns a singleton chunk, eagerly evaluated.

Attributes

Source
Chunk.scala
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.

Attributes

Source
Chunk.scala

Inherited methods

override def concat[A](xss: Iterable[A]*): Chunk[A]

Concatenates all argument collections into a single collection.

Concatenates all argument collections into a single collection.

Type parameters

A

the element type of the collection

Value parameters

xss

the collections that are to be concatenated.

Attributes

Returns

the concatenation of all the collections.

Definition Classes
StrictOptimizedSeqFactory -> IterableFactory
Inherited from:
StrictOptimizedSeqFactory
Source
Factory.scala
def fill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: => A): Chunk[Chunk[Chunk[Chunk[Chunk[A]]]]]

Produces a five-dimensional collection containing the results of some element computation a number of times.

Produces a five-dimensional collection containing the results of some element computation a number of times.

Type parameters

A

the element type of the collection

Value parameters

elem

the element computation

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

n3

the number of elements in the 3rd dimension

n4

the number of elements in the 4th dimension

n5

the number of elements in the 5th dimension

Attributes

Returns

A collection that contains the results of n1 x n2 x n3 x n4 x n5 evaluations of elem.

Inherited from:
IterableFactory
Source
Factory.scala
def fill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: => A): Chunk[Chunk[Chunk[Chunk[A]]]]

Produces a four-dimensional collection containing the results of some element computation a number of times.

Produces a four-dimensional collection containing the results of some element computation a number of times.

Type parameters

A

the element type of the collection

Value parameters

elem

the element computation

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

n3

the number of elements in the 3rd dimension

n4

the number of elements in the 4th dimension

Attributes

Returns

A collection that contains the results of n1 x n2 x n3 x n4 evaluations of elem.

Inherited from:
IterableFactory
Source
Factory.scala
def fill[A](n1: Int, n2: Int, n3: Int)(elem: => A): Chunk[Chunk[Chunk[A]]]

Produces a three-dimensional collection containing the results of some element computation a number of times.

Produces a three-dimensional collection containing the results of some element computation a number of times.

Type parameters

A

the element type of the collection

Value parameters

elem

the element computation

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

n3

the number of elements in the 3rd dimension

Attributes

Returns

A collection that contains the results of n1 x n2 x n3 evaluations of elem.

Inherited from:
IterableFactory
Source
Factory.scala
def fill[A](n1: Int, n2: Int)(elem: => A): Chunk[Chunk[A]]

Produces a two-dimensional collection containing the results of some element computation a number of times.

Produces a two-dimensional collection containing the results of some element computation a number of times.

Type parameters

A

the element type of the collection

Value parameters

elem

the element computation

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

Attributes

Returns

A collection that contains the results of n1 x n2 evaluations of elem.

Inherited from:
IterableFactory
Source
Factory.scala
final def from[A](source: IterableOnce[A]): Chunk[A]

Creates a target collection from an existing source collection

Creates a target collection from an existing source collection

Type parameters

A

the type of the collection’s elements

Value parameters

source

Source collection

Attributes

Returns

a new collection with the elements of source

Inherited from:
ChunkFactory (hidden)
Source
Chunk.scala
def range[A : Integral](start: A, end: A, step: A): Chunk[A]

Produces a collection containing equally spaced values in some integer interval.

Produces a collection containing equally spaced values in some integer interval.

Type parameters

A

the element type of the collection, which must have an Integral instance

Value parameters

end

the end value of the collection (the first value NOT contained)

start

the start value of the collection

step

the difference between successive elements of the collection (must be positive or negative)

Attributes

Returns

a collection with values start, start + step, ... up to, but excluding end

Inherited from:
IterableFactory
Source
Factory.scala
def range[A : Integral](start: A, end: A): Chunk[A]

Produces a collection containing a sequence of increasing of integers.

Produces a collection containing a sequence of increasing of integers.

Type parameters

A

the element type of the collection, which must have an Integral instance

Value parameters

end

the end value of the collection (the first value NOT contained)

start

the first element of the collection

Attributes

Returns

a collection with values start, start + 1, ..., end - 1

Inherited from:
IterableFactory
Source
Factory.scala
override def tabulate[A](n: Int)(f: Int => A): Chunk[A]

Produces a collection containing values of a given function over a range of integer values starting from 0.

Produces a collection containing values of a given function over a range of integer values starting from 0.

Type parameters

A

the element type of the collection

Value parameters

f

The function computing element values

n

The number of elements in the collection

Attributes

Returns

A collection consisting of elements f(0), ..., f(n -1)

Definition Classes
StrictOptimizedSeqFactory -> IterableFactory
Inherited from:
StrictOptimizedSeqFactory
Source
Factory.scala
def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(f: (Int, Int, Int, Int, Int) => A): Chunk[Chunk[Chunk[Chunk[Chunk[A]]]]]

Produces a five-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Produces a five-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Type parameters

A

the element type of the collection

Value parameters

f

The function computing element values

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

n3

the number of elements in the 3rd dimension

n4

the number of elements in the 4th dimension

n5

the number of elements in the 5th dimension

Attributes

Returns

A collection consisting of elements f(i1, i2, i3, i4, i5) for 0 <= i1 < n1, 0 <= i2 < n2, 0 <= i3 < n3, 0 <= i4 < n4, and 0 <= i5 < n5.

Inherited from:
IterableFactory
Source
Factory.scala
def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) => A): Chunk[Chunk[Chunk[Chunk[A]]]]

Produces a four-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Produces a four-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Type parameters

A

the element type of the collection

Value parameters

f

The function computing element values

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

n3

the number of elements in the 3rd dimension

n4

the number of elements in the 4th dimension

Attributes

Returns

A collection consisting of elements f(i1, i2, i3, i4) for 0 <= i1 < n1, 0 <= i2 < n2, 0 <= i3 < n3, and 0 <= i4 < n4.

Inherited from:
IterableFactory
Source
Factory.scala
def tabulate[A](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) => A): Chunk[Chunk[Chunk[A]]]

Produces a three-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Produces a three-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Type parameters

A

the element type of the collection

Value parameters

f

The function computing element values

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

n3

the number of elements in the 3rd dimension

Attributes

Returns

A collection consisting of elements f(i1, i2, i3) for 0 <= i1 < n1, 0 <= i2 < n2, and 0 <= i3 < n3.

Inherited from:
IterableFactory
Source
Factory.scala
def tabulate[A](n1: Int, n2: Int)(f: (Int, Int) => A): Chunk[Chunk[A]]

Produces a two-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Produces a two-dimensional collection containing values of a given function over ranges of integer values starting from 0.

Type parameters

A

the element type of the collection

Value parameters

f

The function computing element values

n1

the number of elements in the 1st dimension

n2

the number of elements in the 2nd dimension

Attributes

Returns

A collection consisting of elements f(i1, i2) for 0 <= i1 < n1 and 0 <= i2 < n2.

Inherited from:
IterableFactory
Source
Factory.scala
final def unapplySeq[A](x: Chunk[A]): UnapplySeqWrapper[A]

Attributes

Inherited from:
SeqFactory
Source
Factory.scala

Concrete fields

val unit: Chunk[Unit]

The unit chunk

The unit chunk

Attributes

Source
Chunk.scala

Implicits

Inherited implicits

implicit def iterableFactory[A]: Factory[A, Chunk[A]]

Attributes

Inherited from:
IterableFactory
Source
Factory.scala