Class/Object

fs2.Chunk

Shorts

Related Docs: object Shorts | package Chunk

Permalink

final case class Shorts(values: Array[Short], offset: Int, length: Int) extends Chunk[Short] with Product with Serializable

Source
Chunk.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Shorts
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Chunk
  7. Segment
  8. AnyRef
  9. 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

Instance Constructors

  1. new Shorts(values: Array[Short], offset: Int, length: Int)

    Permalink

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 Shorts to any2stringadd[Shorts] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. final def ++[O2 >: Short, R2 >: Unit](s2: Segment[O2, R2]): Segment[O2, R2]

    Permalink

    Concatenates this segment with s2.

    Concatenates this segment with s2.

    Definition Classes
    Segment
    Example:
    1. scala> (Segment(1,2,3) ++ Segment(4,5,6)).toVector
      res0: Vector[Int] = Vector(1, 2, 3, 4, 5, 6)
  5. def ->[B](y: B): (Shorts, B)

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

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def append[O2 >: Short, R2](s2: Segment[O2, R2]): Segment[O2, (Unit, R2)]

    Permalink

    Like ++ but allows the result type of s2 to differ from R.

    Like ++ but allows the result type of s2 to differ from R.

    Definition Classes
    Segment
  8. def apply(i: Int): Short

    Permalink

    Returns the element at the specified index.

    Returns the element at the specified index. Throws if index is < 0 or >= size.

    Definition Classes
    ShortsChunk
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. final def asResult[R2](r2: R2): Segment[Short, R2]

    Permalink

    Alias for mapResult( => r2).

    Alias for mapResult( => r2).

    Definition Classes
    Segment
  11. def at(i: Int): Short

    Permalink
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def collect[O2](pf: PartialFunction[Short, O2]): Segment[O2, Unit]

    Permalink

    Filters and maps simultaneously.

    Filters and maps simultaneously.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(Some(1), None, Some(2)).collect { case Some(i) => i }.toVector
      res0: Vector[Int] = Vector(1, 2)
  14. final def cons[O2 >: Short](o2: O2): Segment[O2, Unit]

    Permalink

    Equivalent to Segment.singleton(o2) ++ this.

    Equivalent to Segment.singleton(o2) ++ this.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).toVector
      res0: Vector[Int] = Vector(0, 1, 2, 3)
  15. final def drain: Segment[Nothing, Unit]

    Permalink

    Returns a segment that suppresses all output and returns the result of this segment when run.

    Returns a segment that suppresses all output and returns the result of this segment when run.

    Definition Classes
    Segment
    Example:
    1. scala> Segment.from(0).take(3).drain.run.toOption.get.take(5).toVector
      res0: Vector[Long] = Vector(3, 4, 5, 6, 7)
  16. final def drop(n: Long): Either[(Unit, Long), Segment[Short, Unit]]

    Permalink

    Eagerly drops n elements from the head of this segment, returning either the result and the number of elements remaining to drop, if the end of the segment was reached, or a new segment, if the end of the segment was not reached.

    Eagerly drops n elements from the head of this segment, returning either the result and the number of elements remaining to drop, if the end of the segment was reached, or a new segment, if the end of the segment was not reached.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3,4,5).drop(3).toOption.get.toVector
      res0: Vector[Int] = Vector(4, 5)
      scala> Segment(1,2,3,4,5).drop(7)
      res1: Either[(Unit, Long),Segment[Int,Unit]] = Left(((),2))
  17. final def dropWhile(p: (Short) ⇒ Boolean, dropFailure: Boolean = false): Either[Unit, Segment[Short, Unit]]

    Permalink

    Eagerly drops elements from the head of this segment until the supplied predicate returns false, returning either the result, if the end of the segment was reached without the predicate failing, or the remaining segment.

    Eagerly drops elements from the head of this segment until the supplied predicate returns false, returning either the result, if the end of the segment was reached without the predicate failing, or the remaining segment.

    If dropFailure is true, the first element that failed the predicate will be dropped. If false, the first element that failed the predicate will be the first element of the remainder.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3,4,5).dropWhile(_ < 3).map(_.toVector)
      res0: Either[Unit,Vector[Int]] = Right(Vector(3, 4, 5))
      scala> Segment(1,2,3,4,5).dropWhile(_ < 10)
      res1: Either[Unit,Segment[Int,Unit]] = Left(())
  18. def ensuring(cond: (Shorts) ⇒ Boolean, msg: ⇒ Any): Shorts

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

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

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

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

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

    Permalink
    Definition Classes
    Segment → AnyRef → Any
  24. final def filter[O2](p: (Short) ⇒ Boolean): Segment[Short, Unit]

    Permalink

    Filters output elements of this segment with the supplied predicate.

    Filters output elements of this segment with the supplied predicate.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3,4,5).filter(_ % 2 == 0).toVector
      res0: Vector[Int] = Vector(2, 4)
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. final def flatMap[O2, R2](f: (Short) ⇒ Segment[O2, R2]): Segment[O2, (Unit, Option[R2])]

    Permalink

    List-like flatMap, which applies f to each element of the segment and concatenates the results.

    List-like flatMap, which applies f to each element of the segment and concatenates the results.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).flatMap(i => Segment.seq(List.fill(i)(i))).toVector
      res0: Vector[Int] = Vector(1, 2, 2, 3, 3, 3)
  27. final def flatMapAccumulate[S, O2](init: S)(f: (S, Short) ⇒ Segment[O2, S]): Segment[O2, (Unit, S)]

    Permalink

    Stateful version of flatMap, where the function depends on a state value initialized to init and updated upon each output.

    Stateful version of flatMap, where the function depends on a state value initialized to init and updated upon each output.

    The final state is returned in the result, paired with the result of the source stream.

    Definition Classes
    Segment
    Example:
    1. scala> val src = Segment("Hello", "World", "\n", "From", "Mars").flatMapAccumulate(0)((l,s) =>
           |   if (s == "\n") Segment.empty.asResult(0) else Segment((l,s)).asResult(l + s.length))
      scala> src.toVector
      res0: Vector[(Int,String)] = Vector((0,Hello), (5,World), (0,From), (4,Mars))
      scala> src.void.run
      res1: (Unit,Int) = ((),8)
  28. final def flatMapResult[O2 >: Short, R2](f: (Unit) ⇒ Segment[O2, R2]): Segment[O2, R2]

    Permalink

    Like append but allows to use result to continue the segment.

    Like append but allows to use result to continue the segment.

    Definition Classes
    Segment
  29. final def flatten[O2, R2 >: Unit](implicit ev: <:<[Short, Segment[O2, R2]]): Segment[O2, R2]

    Permalink

    Flattens a Segment[Segment[O2,R],R] in to a Segment[O2,R].

    Flattens a Segment[Segment[O2,R],R] in to a Segment[O2,R].

    Definition Classes
    Segment
    Example:
    1. scala> Segment(Segment(1, 2), Segment(3, 4, 5)).flatten.toVector
      res0: Vector[Int] = Vector(1, 2, 3, 4, 5)
  30. final def flattenChunks[O2](implicit ev: <:<[Short, Chunk[O2]]): Segment[O2, Unit]

    Permalink

    Flattens a Segment[Chunk[O2],R] in to a Segment[O2,R].

    Flattens a Segment[Chunk[O2],R] in to a Segment[O2,R].

    Definition Classes
    Segment
    Example:
    1. scala> Segment(Chunk(1, 2), Chunk(3, 4, 5)).flattenChunks.toVector
      res0: Vector[Int] = Vector(1, 2, 3, 4, 5)
  31. final def fold[B](z: B)(f: (B, Short) ⇒ B): Segment[Nothing, B]

    Permalink

    Folds the output elements of this segment and returns the result as the result of the returned segment.

    Folds the output elements of this segment and returns the result as the result of the returned segment.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3,4,5).fold(0)(_ + _).run
      res0: Int = 15
  32. def foreach(f: (Short) ⇒ Unit): Unit

    Permalink

    Invokes f on each output of this segment.

    Invokes f on each output of this segment.

    Definition Classes
    Segment
    Example:
    1. scala> val buf = collection.mutable.ListBuffer[Int]()
      scala> Segment(1,2,3).cons(0).foreach(i => buf += i)
      res0: Unit = ()
      scala> buf.toList
      res1: List[Int] = List(0, 1, 2, 3)
  33. def foreachChunk(f: (Chunk[Short]) ⇒ Unit): Unit

    Permalink

    Invokes f on each chunk of this segment.

    Invokes f on each chunk of this segment.

    Definition Classes
    ChunkSegment
    Example:
    1. scala> val buf = collection.mutable.ListBuffer[Chunk[Int]]()
      scala> Segment(1,2,3).cons(0).foreachChunk(c => buf += c)
      res0: Unit = ()
      scala> buf.toList
      res1: List[Chunk[Int]] = List(Chunk(0), Chunk(1, 2, 3))
  34. def formatted(fmtstr: String): String

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

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

    Permalink
    Definition Classes
    Segment → AnyRef → Any
  37. def indexWhere(p: (Short) ⇒ Boolean): Option[Int]

    Permalink

    Returns the index of the first element which passes the specified predicate (i.e., p(i) == true) or None if no elements pass the predicate.

    Returns the index of the first element which passes the specified predicate (i.e., p(i) == true) or None if no elements pass the predicate.

    Definition Classes
    Chunk
  38. final def isEmpty: Boolean

    Permalink

    True if size is zero, false otherwise.

    True if size is zero, false otherwise.

    Definition Classes
    Chunk
  39. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  40. def last: Segment[Nothing, (Unit, Option[Short])]

    Permalink

    Returns a segment that suppresses all output and returns the last element output by source segment paired with the source segment result.

    Returns a segment that suppresses all output and returns the last element output by source segment paired with the source segment result.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3).last.run
      res0: (Unit, Option[Int]) = ((),Some(3))
  41. val length: Int

    Permalink
  42. def map[O2](f: (Short) ⇒ O2): Segment[O2, Unit]

    Permalink

    Returns a segment that maps each output using the supplied function.

    Returns a segment that maps each output using the supplied function.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3).map(_ + 1).toVector
      res0: Vector[Int] = Vector(2, 3, 4)
  43. def mapAccumulate[S, O2](init: S)(f: (S, Short) ⇒ (S, O2)): Segment[O2, (Unit, S)]

    Permalink

    Stateful version of map, where the map function depends on a state value initialized to init and updated upon each output value.

    Stateful version of map, where the map function depends on a state value initialized to init and updated upon each output value.

    The final state is returned in the result, paired with the result of the source stream.

    Definition Classes
    Segment
    Example:
    1. scala> val src = Segment("Hello", "World").mapAccumulate(0)((l,s) => (l + s.length, (l, s)))
      scala> src.toVector
      res0: Vector[(Int,String)] = Vector((0,Hello), (5,World))
      scala> src.void.run
      res1: (Unit,Int) = ((),10)
  44. final def mapConcat[O2](f: (Short) ⇒ Chunk[O2]): Segment[O2, Unit]

    Permalink

    Returns a segment that maps each output using the supplied function and concatenates all the results.

    Returns a segment that maps each output using the supplied function and concatenates all the results.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3).mapConcat(o => Chunk.seq(List.range(0, o))).toVector
      res0: Vector[Int] = Vector(0, 0, 1, 0, 1, 2)
  45. final def mapResult[R2](f: (Unit) ⇒ R2): Segment[Short, R2]

    Permalink

    Maps the supplied function over the result of this segment.

    Maps the supplied function over the result of this segment.

    Definition Classes
    Segment
    Example:
    1. scala> Segment('a', 'b', 'c').withSize.mapResult { case (_, size) => size }.void.run
      res0: Long = 3
  46. def mapStrict[O2](f: (Short) ⇒ O2): Chunk[O2]

    Permalink

    Strict version of map.

    Strict version of map.

    Attributes
    protected
    Definition Classes
    ShortsChunk
  47. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  48. final def nonEmpty: Boolean

    Permalink

    False if size is zero, true otherwise.

    False if size is zero, true otherwise.

    Definition Classes
    Chunk
  49. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  51. val offset: Int

    Permalink
  52. final def prepend[O2 >: Short](c: Segment[O2, Any]): Segment[O2, Unit]

    Permalink

    Equivalent to s2 ++ this.

    Equivalent to s2 ++ this.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).prepend(Segment(-1, 0)).toVector
      res0: Vector[Int] = Vector(-1, 0, 1, 2, 3)
  53. final def run[O2 >: Short](implicit ev: =:=[O2, Unit]): Unit

    Permalink

    Computes the result of this segment.

    Computes the result of this segment. May only be called when O is Unit, to prevent accidentally ignoring output values. To intentionally ignore outputs, call s.void.run.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).withSize.void.run
      res0: (Unit,Long) = ((),3)
  54. final def scan[B](z: B, emitFinal: Boolean = true)(f: (B, Short) ⇒ B): Segment[B, B]

    Permalink

    Like fold but outputs intermediate results.

    Like fold but outputs intermediate results. If emitFinal is true, upon reaching the end of the stream, the accumulated value is output. If emitFinal is false, the accumulated output is not output. Regardless, the accumulated value is returned as the result of the segment.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3, 4, 5).scan(0)(_+_).toVector
      res0: Vector[Int] = Vector(0, 1, 3, 6, 10, 15)
  55. def size: Int

    Permalink

    Returns the number of elements in this chunk.

    Returns the number of elements in this chunk.

    Definition Classes
    ShortsChunk
  56. final def splitAt(n: Long): Either[(Unit, Catenable[Segment[Short, Unit]], Long), (Catenable[Segment[Short, Unit]], Segment[Short, Unit])]

    Permalink

    Splits this segment at the specified index by simultaneously taking and dropping.

    Splits this segment at the specified index by simultaneously taking and dropping.

    If the segment has less than n elements, a left is returned, providing the result of the segment, all sub-segments taken, and the remaining number of elements (i.e., size - n).

    If the segment has more than n elements, a right is returned, providing the sub-segments up to the n-th element and a remainder segment.

    The prefix is computed eagerly while the suffix is computed lazily.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3, 4, 5).splitAt(2)
      res0: Either[(Unit,Catenable[Segment[Int,Unit]],Long),(Catenable[Segment[Int,Unit]],Segment[Int,Unit])] = Right((Catenable(Chunk(1, 2)),Chunk(3, 4, 5)))
      scala> Segment(1, 2, 3, 4, 5).splitAt(7)
      res0: Either[(Unit,Catenable[Segment[Int,Unit]],Long),(Catenable[Segment[Int,Unit]],Segment[Int,Unit])] = Left(((),Catenable(Chunk(1, 2, 3, 4, 5)),2))
  57. def splitAtChunk_(n: Int): (Chunk[Short], Chunk[Short])

    Permalink

    Strict version of splitAt - n is guaranteed to be within bounds so implementations do not need to do bounds checking.

    Strict version of splitAt - n is guaranteed to be within bounds so implementations do not need to do bounds checking.

    Attributes
    protected
    Definition Classes
    ShortsChunk
  58. final def splitWhile(p: (Short) ⇒ Boolean, emitFailure: Boolean = false): Either[(Unit, Catenable[Segment[Short, Unit]]), (Catenable[Segment[Short, Unit]], Segment[Short, Unit])]

    Permalink

    Splits this segment at the first element where the supplied predicate returns false.

    Splits this segment at the first element where the supplied predicate returns false.

    Analagous to siumultaneously running takeWhile and dropWhile.

    If emitFailure is false, the first element which fails the predicate is returned in the suffix segment. If true, it is returned as the last element in the prefix segment.

    If the end of the segment is reached and the predicate has not failed, a left is returned, providing the segment result and the catenated sub-segments. Otherwise, a right is returned, providing the prefix sub-segments and the suffix remainder.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3, 4, 5).splitWhile(_ != 3)
      res0: Either[(Unit,Catenable[Segment[Int,Unit]]),(Catenable[Segment[Int,Unit]],Segment[Int,Unit])] = Right((Catenable(Chunk(1, 2)),Chunk(3, 4, 5)))
      scala> Segment(1, 2, 3, 4, 5).splitWhile(_ != 7)
      res0: Either[(Unit,Catenable[Segment[Int,Unit]]),(Catenable[Segment[Int,Unit]],Segment[Int,Unit])] = Left(((),Catenable(Chunk(1, 2, 3, 4, 5))))
  59. final def strict: StrictOps[Short]

    Permalink

    Provides access to strict equivalent methods defined lazily on Segment.

    Provides access to strict equivalent methods defined lazily on Segment.

    Definition Classes
    Chunk
  60. final def sum[N >: Short](implicit N: Numeric[N]): Segment[Nothing, N]

    Permalink

    Sums the elements of this segment and returns the sum as the segment result.

    Sums the elements of this segment and returns the sum as the segment result.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3, 4, 5).sum.run
      res0: Int = 15
  61. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  62. final def take(n: Long): Segment[Short, Either[(Unit, Long), Segment[Short, Unit]]]

    Permalink

    Lazily takes n elements from this segment.

    Lazily takes n elements from this segment. The result of the returned segment is either a left containing the result of the original segment and the number of elements remaining to take when the end of the source segment was reached, or a right containing the remainder of the source segment after n elements are taken.

    Definition Classes
    Segment
    Example:
    1. scala> Segment.from(0).take(3).toVector
      res0: Vector[Long] = Vector(0, 1, 2)
      scala> Segment.from(0).take(3).void.run.toOption.get.take(5).toVector
      res1: Vector[Long] = Vector(3, 4, 5, 6, 7)
      scala> Segment(1, 2, 3).take(5).void.run
      res2: Either[(Unit, Long),Segment[Int,Unit]] = Left(((),2))
  63. final def takeWhile(p: (Short) ⇒ Boolean, takeFailure: Boolean = false): Segment[Short, Either[Unit, Segment[Short, Unit]]]

    Permalink

    Returns a segment that outputs elements while p is true.

    Returns a segment that outputs elements while p is true.

    The result of the returned segment is either the result of the original stream, if the end was reached and the predicate was still passing, or the remaining stream, if the predicate failed. If takeFailure is true, the last element output is the first element which failed the predicate. If takeFailure is false, the first element of the remainder is the first element which failed the predicate.

    Definition Classes
    Segment
    Example:
    1. scala> Segment.from(0).takeWhile(_ < 3).toVector
      res0: Vector[Long] = Vector(0, 1, 2)
      scala> Segment.from(0).takeWhile(_ < 3, takeFailure = true).toVector
      res1: Vector[Long] = Vector(0, 1, 2, 3)
      scala> Segment.from(0).takeWhile(_ < 3).void.run.toOption.get.take(5).toVector
      res2: Vector[Long] = Vector(3, 4, 5, 6, 7)
  64. def toArray[O2 >: Short](implicit arg0: ClassTag[O2]): Array[O2]

    Permalink

    Copies the elements of this chunk to an array.

    Copies the elements of this chunk to an array.

    Definition Classes
    ChunkSegment
  65. def toBooleans[B >: Short](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.

    Definition Classes
    Chunk
  66. def toBytes[B >: Short](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 bytes, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

    Definition Classes
    Chunk
  67. def toCatenable: Catenable[Short]

    Permalink

    Converts this segment to a catenable of output values, discarding the result.

    Converts this segment to a catenable of output values, discarding the result.

    Caution: calling toCatenable on an infinite sequence will not terminate.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).cons(-1).toCatenable.toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  68. def toChunk: Chunk[Short]

    Permalink

    Converts this segment to a single chunk, discarding the result.

    Converts this segment to a single chunk, discarding the result.

    Caution: calling toChunk on an infinite sequence will not terminate.

    Definition Classes
    ChunkSegment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).cons(-1).toChunk
      res0: Chunk[Int] = Chunk(-1, 0, 1, 2, 3)
  69. def toChunks: Catenable[Chunk[Short]]

    Permalink

    Converts this segment to a sequence of chunks, discarding the result.

    Converts this segment to a sequence of chunks, discarding the result.

    Caution: calling toChunks on an infinite sequence will not terminate.

    Definition Classes
    ChunkSegment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).cons(-1).toChunks.toList
      res0: List[Chunk[Int]] = List(Chunk(-1), Chunk(0), Chunk(1, 2, 3))
  70. def toDoubles[B >: Short](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 doubles, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

    Definition Classes
    Chunk
  71. def toFloats[B >: Short](implicit ev: =:=[B, Float]): Floats

    Permalink

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

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

    Definition Classes
    Chunk
  72. def toInts[B >: Short](implicit ev: =:=[B, Int]): Ints

    Permalink

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

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

    Definition Classes
    Chunk
  73. def toList: List[Short]

    Permalink

    Converts this segment to a list, discarding the result.

    Converts this segment to a list, discarding the result.

    Caution: calling toList on an infinite sequence will not terminate.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).cons(-1).toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  74. def toLongs[B >: Short](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 longs, this method runs in constant time. Otherwise, this method will copy of the elements of this chunk in to a single array.

    Definition Classes
    Chunk
  75. def toShorts[B >: Short](implicit ev: =:=[B, Short]): Shorts

    Permalink

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

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

    Definition Classes
    Chunk
  76. def toString(): String

    Permalink
    Definition Classes
    Chunk → AnyRef → Any
  77. def toVector: Vector[Short]

    Permalink

    Converts this segment to a list, discarding the result.

    Converts this segment to a list, discarding the result.

    Caution: calling toList on an infinite sequence will not terminate.

    Definition Classes
    ChunkSegment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).cons(-1).toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  78. final def uncons: Either[Unit, (Segment[Short, Unit], Segment[Short, Unit])]

    Permalink

    Returns the first output sub-segment of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Returns the first output sub-segment of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).cons(0).uncons
      res0: Either[Unit,(Segment[Int,Unit], Segment[Int,Unit])] = Right((Chunk(0),Chunk(1, 2, 3)))
      scala> Segment.empty[Int].uncons
      res1: Either[Unit,(Segment[Int,Unit], Segment[Int,Unit])] = Left(())
  79. final def uncons1: Either[Unit, (Short, Segment[Short, Unit])]

    Permalink

    Returns the first output of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Returns the first output of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Definition Classes
    Segment
    Annotations
    @tailrec()
    Example:
    1. scala> Segment(1, 2, 3).cons(0).uncons1
      res0: Either[Unit,(Int, Segment[Int,Unit])] = Right((0,Chunk(1, 2, 3)))
      scala> Segment.empty[Int].uncons1
      res1: Either[Unit,(Int, Segment[Int,Unit])] = Left(())
  80. def unconsChunk: Either[Unit, (Chunk[Short], Segment[Short, Unit])]

    Permalink

    Returns the first output chunk of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Returns the first output chunk of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Definition Classes
    ChunkSegment
    Example:
    1. scala> Segment(1, 2, 3).prepend(Chunk(-1, 0)).unconsChunk
      res0: Either[Unit,(Chunk[Int], Segment[Int,Unit])] = Right((Chunk(-1, 0),Chunk(1, 2, 3)))
      scala> Segment.empty[Int].unconsChunk
      res1: Either[Unit,(Chunk[Int], Segment[Int,Unit])] = Left(())
  81. final def unconsChunks: Either[Unit, (Catenable[Chunk[Short]], Segment[Short, Unit])]

    Permalink

    Returns the first output chunks of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Returns the first output chunks of this segment along with the remainder, wrapped in Right, or if this segment is empty, returns the result wrapped in Left.

    Differs from unconsChunk when a single step results in multiple outputs.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).prepend(Chunk(-1, 0)).unconsChunks
      res0: Either[Unit,(Catenable[Chunk[Int]], Segment[Int,Unit])] = Right((Catenable(Chunk(-1, 0)),Chunk(1, 2, 3)))
      scala> Segment.empty[Int].unconsChunks
      res1: Either[Unit,(Catenable[Chunk[Int]], Segment[Int,Unit])] = Left(())
  82. val values: Array[Short]

    Permalink
  83. final def void: Segment[Unit, Unit]

    Permalink

    Alias for map(_ => ()).

    Alias for map(_ => ()).

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).void.toList
      res0: List[Unit] = List((), (), ())
  84. final def voidResult: Segment[Short, Unit]

    Permalink

    Returns a new segment which discards the result and replaces it with unit.

    Returns a new segment which discards the result and replaces it with unit.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).take(2).voidResult
      res0: Segment[Int,Unit] = ((Chunk(1, 2, 3)).take(2)).mapResult(<f1>)
  85. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  88. def withSize: Segment[Short, (Unit, Long)]

    Permalink

    Returns a new segment which includes the number of elements output in the result.

    Returns a new segment which includes the number of elements output in the result.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1, 2, 3).withSize.void.run
      res0: (Unit,Long) = ((),3)
  89. def zipWith[O2, R2, O3](that: Segment[O2, R2])(f: (Short, O2) ⇒ O3): Segment[O3, Either[(Unit, Segment[O2, R2]), (R2, Segment[Short, Unit])]]

    Permalink

    Zips this segment with another segment using the supplied function to combine elements from this and that.

    Zips this segment with another segment using the supplied function to combine elements from this and that. Terminates when either segment terminates.

    Definition Classes
    Segment
    Example:
    1. scala> Segment(1,2,3).zipWith(Segment(4,5,6,7))(_+_).toList
      res0: List[Int] = List(5, 7, 9)
  90. def [B](y: B): (Shorts, B)

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Chunk[Short]

Inherited from Segment[Short, Unit]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Shorts to any2stringadd[Shorts]

Inherited by implicit conversion StringFormat from Shorts to StringFormat[Shorts]

Inherited by implicit conversion Ensuring from Shorts to Ensuring[Shorts]

Inherited by implicit conversion ArrowAssoc from Shorts to ArrowAssoc[Shorts]

Ungrouped