Trait/Object

fs2

Chunk

Related Docs: object Chunk | package fs2

Permalink

trait Chunk[+A] extends AnyRef

A strict, in-memory sequence of A values.

Chunks can be constructed via various constructor methods on the Chunk companion object.

Chunks are internally specialized for both single element chunks and unboxed arrays of primitives.

Supports unboxed operations for booleans, bytes, longs, and doubles, using a Chunk implementation that is backed by an array of primitives. When possible, operations on Chunk preserves unboxed-ness. To get access the the underlying unboxed arrays, use toBooleans, toBytes, toLongs, and toDoubles.

Note: the NonEmptyChunk type is a subtype of Chunk which is limited to chunks with at least one element.

Self Type
Chunk[A]
Source
Chunk.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Chunk
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(i: Int): A

    Permalink

    Gets the i-th element of this chunk, throwing an IndexOutOfBoundsException if the index is not in the range [0,size).

  2. abstract def copyToArray[B >: A](xs: Array[B], start: Int = 0): Unit

    Permalink

    Copies the elements of this chunk in to the specified array at the specified start index.

  3. abstract def drop(n: Int): Chunk[A]

    Permalink

    Returns a new chunk made up of the elemenets of this chunk without the first n elements.

  4. abstract def filter(f: (A) ⇒ Boolean): Chunk[A]

    Permalink

    Returns a new chunk made up of the elements of this chunk for which the specified predicate returns true.

  5. abstract def foldLeft[B](z: B)(f: (B, A) ⇒ B): B

    Permalink

    Reduces this chunk to a value of type B by applying f to each element, left to right, passing the output of each invocation of f to the next invocation of f and starting with z.

  6. abstract def foldRight[B](z: B)(f: (A, B) ⇒ B): B

    Permalink

    Reduces this chunk to a value of type B by applying f to each element, right to left, passing the output of each invocation of f to the next invocation of f and starting with z.

  7. abstract def size: Int

    Permalink

    Returns the number of elements in this chunk.

  8. abstract def take(n: Int): Chunk[A]

    Permalink

    Returns a new chunk made up of the first n elemenets of this chunk.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to any2stringadd[Chunk[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Chunk[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to ArrowAssoc[Chunk[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def collect[B](pf: PartialFunction[A, B]): Chunk[B]

    Permalink

    Maps and filters this chunk simultaneously using the supplied partial function.

  9. def ensuring(cond: (Chunk[A]) ⇒ Boolean, msg: ⇒ Any): Chunk[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to Ensuring[Chunk[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (Chunk[A]) ⇒ Boolean): Chunk[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to Ensuring[Chunk[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): Chunk[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to Ensuring[Chunk[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): Chunk[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to Ensuring[Chunk[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(a: Any): Boolean

    Permalink
    Definition Classes
    Chunk → AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to StringFormat[Chunk[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    Chunk → AnyRef → Any
  19. def indexWhere(p: (A) ⇒ Boolean): Option[Int]

    Permalink

    Returns the index of the first element for which p returns true.

  20. def isEmpty: Boolean

    Permalink

    Returns true if this chunk has no elements.

  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. def iterator: Iterator[A]

    Permalink

    Creates an iterator that iterates the elements of this chunk.

    Creates an iterator that iterates the elements of this chunk. The returned iterator is not thread safe.

  23. def map[B](f: (A) ⇒ B): Chunk[B]

    Permalink

    Applies f to each element of this chunk, resulting in a new chunk of the same size.

  24. def mapAccumulate[S, B](s0: S)(f: (S, A) ⇒ (S, B)): (S, Chunk[B])

    Permalink

    Simultaneously folds and maps this chunk, returning the output of the fold and the transformed chunk.

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def nonEmpty: Boolean

    Permalink

    Returns true if this chunk has at least 1 element.

  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def scanLeft[B](z: B)(f: (B, A) ⇒ B): Chunk[B]

    Permalink

    Like foldLeft but each intermediate B value is output.

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]

    Permalink

    Copies the elements of this chunk to an array.

  32. def toBooleans[B >: A](implicit ev: =:=[B, Boolean]): Booleans

    Permalink

    Converts this chunk to a Chunk.Booleans, allowing access to the underlying array of elements.

    Converts this chunk to a Chunk.Booleans, allowing access to the underlying array of elements. If this chunk is already backed by an unboxed array of booleans, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

  33. def toBytes[B >: A](implicit ev: =:=[B, Byte]): Bytes

    Permalink

    Converts this chunk to a Chunk.Bytes, allowing access to the underlying array of elements.

    Converts this chunk to a Chunk.Bytes, allowing access to the underlying array of elements. If this chunk is already backed by an unboxed array of booleans, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

  34. def toDoubles[B >: A](implicit ev: =:=[B, Double]): Doubles

    Permalink

    Converts this chunk to a Chunk.Doubles, allowing access to the underlying array of elements.

    Converts this chunk to a Chunk.Doubles, allowing access to the underlying array of elements. If this chunk is already backed by an unboxed array of booleans, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

  35. def toList: List[A]

    Permalink

    Converts this chunk to a list.

  36. def toLongs[B >: A](implicit ev: =:=[B, Long]): Longs

    Permalink

    Converts this chunk to a Chunk.Longs, allowing access to the underlying array of elements.

    Converts this chunk to a Chunk.Longs, allowing access to the underlying array of elements. If this chunk is already backed by an unboxed array of booleans, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

  37. def toString(): String

    Permalink
    Definition Classes
    Chunk → AnyRef → Any
  38. def toVector: Vector[A]

    Permalink

    Converts this chunk to a vector.

  39. def uncons: Option[(A, Chunk[A])]

    Permalink

    If this chunk is non-empty, returns the first element of the chunk and the rest as a new chunk.

    If this chunk is non-empty, returns the first element of the chunk and the rest as a new chunk. Otherwise, returns none.

  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def [B](y: B): (Chunk[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Chunk[A] to ArrowAssoc[Chunk[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Chunk[A] to any2stringadd[Chunk[A]]

Inherited by implicit conversion StringFormat from Chunk[A] to StringFormat[Chunk[A]]

Inherited by implicit conversion Ensuring from Chunk[A] to Ensuring[Chunk[A]]

Inherited by implicit conversion ArrowAssoc from Chunk[A] to ArrowAssoc[Chunk[A]]

Ungrouped