abstract class _Class[A] extends Stream.Interface[A] with Stream.Flow[A] with Any.Able.Void with _extend[A] with _consume[A] with _iterate[A] with _info[A]

Stream is a one time lazy channel to some source of elements

Stream can be extended with a transformation operation, which can potentially add, remove or modify elements passing from original source. From this moment we deal only with new transformed stream. Extension is lazy and does not request any elements to be delivered

Stream can be iterated, delivering elements one by one. Even after iteration stream can still be extended

At the end of life cycle Stream can be consumed. A consume operation may use all or some elements, nevertheless the Stream MUST be discarded, because its behavior is no longer predictable

val stream = ('a' <> 'z')  // Range of Chars
  .all                     // A Stream of Chars from 'a' to 'z' is created
  .dropNext(3)             // Extended, loosing 'a', 'b', and 'c'

stream.next.lp             // Iterated, prints d
stream.next.lp             // Iterated, prints e
stream.take(5).lp          // Iterated, prints ~(f, g, h, i, j)

stream
  .let(_ <= 'w')           // Extended with filter to only allow Chars <= 'w'
  .map(_.toUpper)          // Extended with conversion to upper case
  .foreach(print)          // Consumed, while printing each element

// Output
KLMNOPQRSTUVW
Ordering
  1. Alphabetic
Inherited
  1. Stream
  2. Stream._info
  3. Stream._iterate
  4. Stream._consume
  5. Stream._consume._foreach
  6. Stream._consume._evaluate
  7. Stream._consume._convert
  8. Stream._consume._aggregate
  9. Stream._extend
  10. Stream._extend._zip
  11. Stream._extend._trigger
  12. Stream._extend._peek
  13. Stream._extend._order
  14. Stream._extend._map
  15. Stream._extend._group
  16. Stream._extend._flow
  17. Stream._extend._filter
  18. Stream._extend._add
  19. Any.Able.Void
  20. Stream.Flow
  21. Stream.Flow._info
  22. Stream.Flow._consume
  23. Stream.Flow._consume._foreach
  24. Stream.Flow._consume._evaluate
  25. Stream.Flow._consume._convert
  26. Any.Able.ToText
  27. Stream.Flow._consume._aggregate
  28. Stream.Flow._extend
  29. Stream.Flow._extend._peek
  30. Stream.Flow._extend._map
  31. Stream.Flow._extend._flow
  32. Stream.Flow._extend._filter
  33. Stream.Flow._extend.Z.Shared
  34. Stream.Interface
  35. scala.AnyRef
  36. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Constructor

  1. new Stream()
    Attributes
    protected
    Definition Classes
    _Class

Method

  1. def append(element: A): ~[A]

    Append

    Append

    Creates a new Stream with given element appended to this Stream

    (1 <> 5).all.append(99).append(100) lp
    
    // Output
    ~(1, 2, 3, 4, 5, 99, 100)

    Note. Append has operator alias +

    Definition Classes
    _Class_add
  2. def appendAll(that: ~[A]): ~[A]

    Append all

    Append all

    Creates a new Stream with that Stream appended to this Stream

    ('1' <> '9').all.appendAll('a' <> 'd').appendAll('A' <> 'D').lp
    
    // Output
    ~(1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, A, B, C, D)
    Definition Classes
    _Class_add
  3. def apply(c: Consumer[A], forEmpty: ⇒ Any = \/): Unit

    For each or for empty

    For each or for empty

    Calls foreach if there are elements

    Executes forEmpty otherwise

    Definition Classes
    _Class_foreach
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def average(implicit n: Numeric[A]): A

    Average

    Average

    Computes average

    (10.0 <> 15.0).all.average.lp // Prints: 12.5
    Definition Classes
    _Class_aggregate
  6. def averageFew[B](f: Mapping[A, B]*)(implicit arg0: Numeric[B]): Idx[B]

    Multi average

    Multi average

    Simultaneously computes multiple average values for properties specified by several functions

    Returns Idx with values corresponding to the given mappings

    For empty pipelines returned Idx will still hold zero numerics, but will test isVoid positive

    def average3(stream: ~[Int]): Idx[Int] = stream.averageFew(AS_IS, _ * 10, _ * 100)
    
    average3(1 <> 10).all lp   // Prints: ~(5, 55, 550)
    
    average3(\/).all lp        // Prints: ~(0, 0, 0)
    
    average3(\/).I.Opt lp      // Prints: Opt.Void

    Note: Currently this method is not specialized and will auto box primitives

    Definition Classes
    _Class_aggregate
  7. def chainDepth: Int

    Depth of transformations

    Depth of transformations

    The original Stream to the source returns 1, each transformation adds 1 more

    ('a' <> 'z').all.let(_ > 'X').map(_.toUpper).chainDepth.lp // Prints 3

    Note. Some transformations can be optimized, so the returned depth can be lower than expected

    ('a' <> 'z').all.dropNext(3).map(_.toUpper).chainDepth.lp  // Prints 2
    
    // Note: dropNext(3) is a simple cursor movement on indexed stream without additional depth
    Definition Classes
    _Trait
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def contains[B >: A](value: B): Boolean

    Includes check

    Includes check

    Returns true if there is element equal to the given value

    def all = ('a' <> 'f').all
    
    all.contains('c').lp       // Prints: true
    
    all.contains('y').lp       // Prints: false
    Definition Classes
    _Class_evaluate_evaluate
  10. def copyTo(b: Idx.Array.Buffer.Loader[A]): Unit

    Copy to buffer

    Copy to buffer

    This is potentially the most efficient way to get all Stream elements

    Idx.Array.Buffer.Loader provides a trustless way to copy arrays in bulk, so many array based Streams can take advantage of this

    Definition Classes
    _Class_convert
  11. def count(f: Filter[A]): Int

    Element conditional count

    Element conditional count

    Returns count of elements satisfying the filter

    Definition Classes
    _Class_evaluate_evaluate
  12. def count: Int

    All elements count

    All elements count

    Returns count of all elements

    ('a' <> 'z').all.count.lp  // Prints: 26
    Definition Classes
    _Class_evaluate_evaluate
  13. def countAndTime: (Int, Duration)

    Element count and time

    Element count and time

    Returns count of all elements and the Duration it took to pump the pipeline

    (1 <> 1000).all.peek(_ => App.pause(1.Millis)).countAndTime.lp // Prints: (1000,1.004 sec)
    Definition Classes
    _Class_evaluate_evaluate
  14. def countFew(f: Filter[A]*): Idx[Int]

    Element multi count

    Element multi count

    Counts elements for several filters at once

    Returns Idx[Int], where each Int corresponds to the given filter index

    If the pipeline is empty, the resulting Idx will still hold 0 in each position, but will test isVoid positive

    f

    several filters

    Definition Classes
    _Class_evaluate_evaluate
    Example:
    1. val (all, odd, even) = (1 <> 50).all.countFew(ANY, _ % 2 == 1, _ % 2 == 0).toTuple3
      
      "all=" + all lp;    // Prints: all=50
      "odd=" + odd lp;    // Prints: odd=25
      "even=" + even lp;  // Prints: even=25
      
       // ----------------------------------------------------------------------------------
      
      def count(stream: ~[Int]): Idx[Int] = stream.countFew(_ < 10, _ > 20, 30 <> 60)
      
      count(1 <> 50).all lp  // Prints: ~(9, 30, 21)
      
      count(\/).all lp       // Prints: ~(0, 0, 0)
      
      count(\/).Opt lp       // Prints: Opt.Void
  15. def default(element: ⇒ A): Stream[A]

    Default element

    Default element

    If this Stream is empty, the given element will be appended

    Otherwise this Stream elements will not change

    (1 <>> 1).all.default(99).lp // Prints: ~(99)
    
    (1 <>> 5).all.default(99).lp // Prints: ~(1, 2, 3, 4)
    Definition Classes
    _Class_add
  16. def drain: Unit

    Discharge everything

    Discharge everything

    Calls foreach, discarding all retrieved elements

    Even though nothing is done at this point, this method can be run for the benefit of other functions in the pipeline

    ('A' <> 'C').all.peek("Process " + _ lp).drain
    
    // Output
    Process A
    Process B
    Process C
    Definition Classes
    _Class_foreach
  17. def drop(f: Filter[A]): Stream[A]

    Reversed filter

    Reversed filter

    Discards all the elements satisfying the filter

    (1 <> 10).all.drop(_ % 2 == 0).lp // Prints: ~(1, 3, 5, 7, 9)
    Definition Classes
    _Class_filter_filter
  18. def dropAll(a: ~[A])(implicit c: Ordering[A] = \/): Stream[A]

    Group reversed filter

    Group reversed filter

    Discards all elements equal to the found in that stream

    val idx = (1 <> 5).all.flatMap(_.I repeat 3).to[Idx]
    
    idx.all.lp                      // Prints: ~(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5)
    
    idx.all.dropAll(3 <> 7).lp      // Prints: ~(1, 1, 1, 2, 2, 2)
    
    idx.all.dropAll(2 ~+ 5 + 11).lp // Prints: ~(1, 1, 1, 3, 3, 3, 4, 4, 4)
    Definition Classes
    _Class_filter
    Note

    The operation is very efficient if streams are sorted

  19. def dropAllBy[B](f: Mapping[A, B], a: ~[B])(implicit c: Ordering[B] = \/): Stream[A]

    Property group reversed filter

    Property group reversed filter

    Discards elements, which produce property value equal to the found in that stream

    ("abc" ~+ "d" + "e" + "" + "fg" + "hijk").dropAllBy(_.length, 0 ~+ 3).lp
    
    // Output
    ~(d, e, fg, hijk)
    Definition Classes
    _Class_filter
    Note

    The operation is very efficient if streams are sorted

  20. def dropAt(r: Idx.Range): Stream[A]

    Sequence range reversed filter

    Sequence range reversed filter

    Discards sequence elements, which fall within the specified range

    (1 <> 10).all.dropAt(3 <> 7).lp
    
    // Output
    ~(1, 2, 3, 9, 10)
    Definition Classes
    _Class_filter
  21. def dropEverythingIf(b: Boolean): Stream[A]

    Discarding everything

    Discarding everything

    With a single test lets to drop the entire pipeline in favor of void instance

    Note: This can also be done with 'if-else' outside the pipeline, however it proved to be useful with really long pipeline statements

    (1 <> 10).all.dropEverythingIf(true).lp
    
    // Output
    void
    Definition Classes
    _Class_filter
  22. def dropLast(n: Int): Stream[A]

    Sequence tail reversed filter

    Sequence tail reversed filter

    Discards the last consecutive number of elements in the sequence

    (1 <> 10).all.dropLast(3).lp
    
    // Output
    ~(1, 2, 3, 4, 5, 6, 7)
    Definition Classes
    _Class_filter
  23. def dropNext(n: Int): Stream[A]

    Sequence head reversed filter

    Sequence head reversed filter

    Discards the first consecutive number of elements in the sequence

    (1 <> 10).all.dropNext(3).lp
    
    // Output
    ~(4, 5, 6, 7, 8, 9, 10)
    Definition Classes
    _Class_filter
  24. def dropVoid: Stream[A]

    Reversed filter for void

    Reversed filter for void

    Discards all the objects which test Any.isVoid positive from the pipeline

    def all = ("A" ~+ null + "B" + "" + "C")
    
    all.lp              // Prints: ~(A, null, B, void, C)
    
    all.dropVoid.lp     // Prints: ~(A, B, C)
    Definition Classes
    _Class_filter_filter
  25. def dropWhile(f: Filter[A]): Stream[A]

    Sequence head reversed filter

    Sequence head reversed filter

    Discards first consecutive elements satisfying the filter

    Note, everything starting from the first non compliant element will be allowed (including later compliant elements)

    def all = (1 <> 5).all +~ (1 <> 5)
    
    all.lp                     // Prints ~(1, 2, 3, 4, 5, 1, 2, 3, 4, 5)
    
    all.dropWhile(_ <= 3).lp   // Prints ~(4, 5, 1, 2, 3, 4, 5)
    Definition Classes
    _Class_filter
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def find(f: Filter[A]): A

    Find

    Find

    Returns the first element satisfying the given filter

    Fails if none found

    (1 <> 1000).all.find(_ > 100).lp  // Prints: 101
    Definition Classes
    _Class_evaluate_evaluate
  30. def findAnyOpt: Opt[A]
    Attributes
    protected
    Definition Classes
    _evaluate_evaluate
  31. def findIdxOpt(f: Filter[A]): Opt.Int

    Find index

    Find index

    Optionally returns index for the first element satisfying the filter function or Opt.Void if none found

    (50 <> 500).all.findIdxOpt(_ == 400).lp // Prints: Opt(350)
    Definition Classes
    _Class_evaluate
  32. def findNextOpt(f: Filter[A]): Opt[A]

    Find next element

    Find next element

    Iterates elements until the first satisfying the filter is found

    Definition Classes
    _Class_Trait
  33. def findOpt(f: Filter[A]): Opt[A]

    Find

    Find

    Optionally returns the first element satisfying the given filter

    (1 <> 1000).all.findOpt(_ > 100).lp  // Prints: Opt(101)
    Definition Classes
    _Class_evaluate_evaluate
  34. def flatMap[B](f: Mapping[A, ~[B]])(implicit i: Ilk[B]): Stream[B]

    Map multiplier

    Map multiplier

    For every existing element, a mapped stream of elements is inserted into the pipeline

    Note. The mapping can return an empty stream, in which case total number of elements might even be reduced

    f

    function to provide a stream of elements for each existing element

    Definition Classes
    _Class_map_map
    Example:
    1. ~.*(1, 2, 3).flatMap(i => ~.*(i * 10, i * 100, i * 1000)).lp
      
      // Output
      ~(10, 100, 1000, 20, 200, 2000, 30, 300, 3000)
  35. def flatten[B](implicit f: Mapping[A, ~[B]], i: Ilk[B]): Stream[B]

    Converts a stream of streams into a flat stream

    Converts a stream of streams into a flat stream

    val stream: ~[~[Char]] = ~.*(
      'a' <> 'd',
      List('x', 'y', 'z'),
      Vector('v', 'e', 'c', 't', 'o', 'r'))
    
    stream.flatten.lp // Prints: ~(a, b, c, d, x, y, z, v, e, c, t, o, r)
    Definition Classes
    _Class_map
  36. def fold(start: A)(op: Folding[A]): A

    Basic fold

    Basic fold

    Folds elements with a binary function

    Returns start value for empty pipeline

    start

    seed value to start with

    Definition Classes
    _Class_aggregate_aggregate
    Example:
    1. // Multiply every element by next
      
      (1 <> 10).all.fold(1, _ * _).lp   // Prints: 3628800
  37. def foldAs[B](start: B)(op: Folding.As[B, A])(implicit i: Ilk[B]): B

    Fold and convert

    Fold and convert

    Folds and converts elements with a binary function

    // Calculate sum of first 1000 Ints
    
    (1 <> 1000).all.foldAs[Long](0L, _ + _).lp // Prints: 500500
    start

    seed value to start with

    Definition Classes
    _Class_aggregate
  38. def foldFlowAs[B](start: B)(op: Folding.As[B, A], cf: Folding[B] = null)(implicit arg0: Ilk[B]): B

    foldAs

    foldAs

    For Stream this method is same as foldAs

    Only use it when dealing with Stream.Flow interface

    start

    seed value to start with

    cf

    collect function to put together results of parallel computations. It is not required and ignored for Stream

    Definition Classes
    _Class_aggregate_aggregate
  39. abstract def foreach(f: Consumer[A]): Unit

    For each

    For each

    Applies given function for each element

    (1 <> 3).all.foreach("Element: " + _ lp)
    
    // Output
    Element: 1
    Element: 2
    Element: 3
    Definition Classes
    _foreach
  40. def foreachIdx(f: Consumer.Idx[A], start: Int = 0): Unit

    For each indexed

    For each indexed

    Calls foreach with counter

    start

    starting value for the index in the f function

    ('A' <> 'C').all.foreachIdx("Element " + _ + " = " + _ lp, 1)
    
    // Output
    Element 1 = A
    Element 2 = B
    Element 3 = C
    Definition Classes
    _Class_foreach
  41. def foreachSynchronized(f: Consumer[A]): Unit

    Calls foreach

    Calls foreach

    foreachSynchronized is inherited from Stream.Flow, which could be parallel

    Stream is sequential by itself, so foreachSynchronized is same as regular foreach

    Definition Classes
    _Class_foreach_foreach
  42. def format(s: Opt[String] = \/, pb: Opt[String] = \/, pa: Opt[String] = \/, c: Opt[(A) ⇒ String] = \/): String

    Elements as String

    Elements as String

    All elements are converted toString

    The results are concatenated with possible use of padding and separator

    Definition Classes
    _Class_convert
    Example:
    1. ('a' <> 'z').all.format().lp
      ('a' <> 'z').all.format("|").lp
      ('a' <> 'z').all.format(",", "[", "]").lp
      
      // Output
      abcdefghijklmnopqrstuvwxyz
      
      a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
      
      [a],[b],[c],[d],[e],[f],[g],[h],[i],[j],[k],[l],[m],[n],[o],[p],[q],[r],[s],[t],[u],[v],[w],[x],[y],[z]
  43. def group(test: (A, A) ⇒ Boolean, peekSplit: (A, Boolean) ⇒ Any = \/): Stream[~[A]]

    Group by test

    Group by test

    Puts elements in the same group based on a function test for every two consecutive elements

    test

    function for two consecutive elements. if 'false' is returned, the second tested element will start a new group

    peekSplit

    function to run for each piped element. Boolean parameter indicates if the element starts a new group

    Definition Classes
    _Class_group
    Example:
    1. // Putting Ints into groups of 3
      (0 <> 20).all.group(_ / 3 == _ / 3).tp
      
      // Output
      
      ---------------
      ?
      ---------------
      ~(0, 1, 2)
      ~(3, 4, 5)
      ~(6, 7, 8)
      ~(9, 10, 11)
      ~(12, 13, 14)
      ~(15, 16, 17)
      ~(18, 19, 20)
      ---------------
  44. def group: Stream[~[A]]

    Simple grouping

    Simple grouping

    Puts consecutive elements in the same group if they are equal

    Note: Non consecutive equal elements will end up in different groups. Prior ordering might be needed

    Definition Classes
    _Class_group
    Example:
    1. def all =  ~.*(1, 2, 3).flatMap(_.I.repeat(3))
      
      all.lp
      
      all.group.tp
      
      // Output
      ~(1, 1, 1, 2, 2, 2, 3, 3, 3)
      
      ------------
      ?
      ------------
      ~(1, 1, 1)
      ~(2, 2, 2)
      ~(3, 3, 3)
      ------------
  45. def groupBy(properties: Mapping[A, Any]*): Stream[~[A]]

    Grouping on properties

    Grouping on properties

    Puts consecutive elements in the same group if all the specified properties are equal

    When properties change, a new group is started

    properties

    a set of functions, each indicating an element property

    Definition Classes
    _Class_group
    Example:
    1.  ('#' <> '|').all.groupBy(_.isLetter, _.isDigit).tp
      
      // Output
      ---------------------------------------------------------------------------------
      ?
      ---------------------------------------------------------------------------------
      ~(#, $, %, &, ', (, ), *, +, ,, -, ., /)
      ~(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
      ~(:, ;, <, =, >, ?, @)
      ~(A, B, C, D, E, F, G, H, Stream, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)
      ~([, \, ], ^, _, `)
      ~(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)
      ~({, |)
      ---------------------------------------------------------------------------------
  46. def groupBySize(size: Int): Stream[~[A]]

    Fixed size groups

    Fixed size groups

    Puts consecutive elements into fixed size groups

    size

    of groups. Cannot be less than 1.

    Definition Classes
    _Class_group
    Example:
    1. 0.I.repeat(30).groupBySize(8).toText.lp
      
      // Output
      
      -------------------------
      ?
      -------------------------
      ~(0, 0, 0, 0, 0, 0, 0, 0)
      ~(0, 0, 0, 0, 0, 0, 0, 0)
      ~(0, 0, 0, 0, 0, 0, 0, 0)
      ~(0, 0, 0, 0, 0, 0)
      -------------------------
  47. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  48. abstract def ilkOpt: Opt[Any.Ilk]

    Data Any.Ilk if known

    Data Any.Ilk if known

    Stream elements Any.Ilk if known for granted

    Definition Classes
    _Trait
  49. def insertAllAt(index: Int, that: ~[A]): Stream[A]

    Insert stream at

    Insert stream at

    Creates a new Stream with that Stream inserted into this Stream

    index

    position in the current stream to insert elements at. If index is out of range, the elements are prepended or appended

    Definition Classes
    _Class_add
    Example:
    1. ('a' <> 'f').all.insertAllAt(3, 'X' <> 'Z').lp
      
      // Output
      ~(a, b, c, X, Y, Z, d, e, f)
  50. def insertAt(index: Int, element: A): Stream[A]

    Insert at

    Insert at

    Creates a new Stream with given element inserted into this Stream

    index

    position in the current stream to insert element at. If index is out of range, the element is prepended or appended

    ('a' <> 'd').all.insertAt(2, 'X').lp
    
     // Output
     ~(a, b, X, c, d)
    Definition Classes
    _Class_add
  51. def isAny(f: Filter[A]): Boolean

    Any check

    Any check

    Returns true if there is an element satisfying the filter

    def all = (1 <> 100).all
    
    all.isAny(_ > 10).lp   // Prints: true
    
    all.isAny(_ > 100).lp  // Prints: false
    Definition Classes
    _Class_evaluate_evaluate
  52. def isEvery(f: Filter[A]): Boolean

    Every check

    Every check

    Returns true if every element is satisfying the filter

    def all = (1 <> 100).all
    
    all.isEvery(_ > 10).lp   // Prints: false
    
    all.isEvery(_ > 0).lp    // Prints: true
    Definition Classes
    _Class_evaluate_evaluate
  53. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  54. final def isParallel: Boolean

    Parallel check

    Parallel check

    Returns true if this Flow is parallel

    Definition Classes
    _Trait_Trait
  55. def isVoid: Boolean

    Void check

    Void check

    Returns true if this instance is void

    Definition Classes
    Void
  56. def last: A

    Last element

    Last element

    Returns the last data element

    Fails if no data

    Definition Classes
    _Class_evaluate
  57. def lastOpt: Opt[A]

    Last element

    Last element

    Optionally returns the last element or Opt.Void

    Definition Classes
    _Class_evaluate
  58. def let(f: Filter[A]): Stream[A]

    Main filter

    Main filter

    Only lets elements satisfying the filter

    let is the main filtering method. It's equivalent in Java and Scala is called filter

    (1 <> 10).all.let(_ % 2 == 0).lp // Prints: ~(2, 4, 6, 8, 10)
    Definition Classes
    _Class_filter_filter
  59. def letAll(that: ~[A])(implicit o: Ordering[A] = \/): Stream[A]

    Group filter

    Group filter

    Only lets elements equal to the found in that stream

    val idx = (1 <> 5).all.flatMap(_.I repeat 3).to[Idx]
    
    idx.all.lp                     // Prints: ~(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5)
    
    idx.all.letAll(3 <> 7).lp      // Prints: ~(3, 3, 3, 4, 4, 4, 5, 5, 5)
    
    idx.all.letAll(2 ~+ 5 + 11).lp // Prints: ~(2, 2, 2, 5, 5, 5)
    Definition Classes
    _Class_filter
    Note

    The operation is very efficient if streams are sorted

  60. def letAllBy[B](f: Mapping[A, B], that: ~[B])(implicit c: Ordering[B] = \/): Stream[A]

    Property group filter

    Property group filter

    Only lets elements, which produce property value equal to the found in that stream

    ("abc" ~+ "d" + "e" + "" + "fg" + "hijk").letAllBy(_.length, 0 ~+ 1 + 2).lp
    
    // Output
    ~(d, e, void, fg)
    Definition Classes
    _Class_filter
    Note

    The operation is very efficient if streams are sorted

  61. def letAt(r: Idx.Range): Stream[A]

    Sequence range filter

    Sequence range filter

    Only lets elements within given index range

    ('a' <> 'z').all.letAt(1 <> 7).lp
    
    // Output
    ~(b, c, d, e, f, g, h)
    Definition Classes
    _Class_filter
  62. def letBy[T](as: Mapping[A, T], f: Filter[T]): Stream[A]

    Property filter

    Property filter

    Only lets elements satisfying the filter on given property

    val filter: Stream.Filter[Int] = _ >= 2
    
    ("ABC" ~+ "D" + "E" + "FG").letBy(_.length, filter).lp // Prints: ~(ABC, FG)

    Note: This might be useful when existing filters are reused

    Definition Classes
    _Class_filter_filter
  63. def letIdx(f: Filter.Idx[A], start: Int = 0): Stream[A]

    Indexed filter

    Indexed filter

    Only lets elements satisfying the filter

    f

    filter

    start

    the starting index value

    ('a' <> 'z').all.letIdx((i, v) => i >= 2 && i <= 7, 1).lp
    
    // Output
    ~(b, c, d, e, f, g)
    Definition Classes
    _Class_filter
  64. def letLast(n: Int): Stream[A]

    Sequence tail filter

    Sequence tail filter

    Only lets last number of elements

    (1 <> 10).all.letLast(3).lp
    
    // Output
    ~(8, 9, 10)
    Definition Classes
    _Class_filter
  65. def letLookup[B](f: PartialFunction[A, B])(implicit arg0: Ilk[B]): Stream[B]

    Filter and converter

    Filter and converter

    Only lets elements for which given PartialFinction is defined

    The elements are converted to the new type

    def all = ~[Any] + "ABC" + 1 + 22.0 + "DE" + 333F + "F"
    
    all.letLookup({ case s: String if (s.length > 1) => s }).lp
    
    // Output
    ~(ABC, DE)
    Definition Classes
    _Class_map_filter → Shared
    Note

    'letLookup' always requires double evaluation for each element, so 'letMap' is preferred in many cases

  66. def letMap[B](f: Mapping[A, Opt[B]])(implicit i: Ilk[B]): Stream[B]

    Filter and converter

    Filter and converter

    Only lets elements for which given function returns non empty Opt

    The elements are converted to the new type

    def all = "ABC" ~+ "1" + "22" + "D" + "333" + "E"
    
    all.letMap(v => if (v.length < 2) \/ else v).lp // Prints: ~(ABC, 22, 333)
    
    all.letMap({
      case s if (s.length >= 2) => s
      case _                    => \/
    }).lp                                           // Prints: ~(ABC, 22, 333)
    
    all.letMap(_.toIntOut.valueOpt).lp              // Prints: ~(1, 22, 333)

    Note: 'letMap' is a better alternative to letLookup with PartialFunction, because it is evaluated just once for each element

    Definition Classes
    _Class_map_filter → Shared
  67. def letNext(n: Int): Stream[A]

    Sequence head filter

    Sequence head filter

    Only lets first number of elements

    Note: This might look like take, but it is more efficient (take immediately iterates the elements creating a new stream)

    (1 <> 10).all.letNext(3).lp
    
    // Output
    ~(1, 2, 3)
    Definition Classes
    _Class_filter
  68. def letType[B](implicit t: ClassTag[B]): Stream[B]

    Filter and type converter

    Filter and type converter

    Only lets elements, which are instances of the given type

    Note, the result is mapped to the specified type

    def all = ~[Any] + "1" + 2 + 3.0 + 4l + "5"
    
    all.lp                  // Prints ~(1, 2, 3.0, 4, 5)
    
    all.letType[String].lp  // Prints ~(1, 5)
    Definition Classes
    _Class_map_filter → Shared
  69. def letWhile(f: Filter[A]): Stream[A]

    Sequence head filter

    Sequence head filter

    Only lets first consecutive elements satisfying the filter

    Note, everything starting from the first non compliant element will be discarded (including later compliant elements)

    def all = (1 <> 5).all +~ (1 <> 5)
    
    all.lp                     // Prints ~(1, 2, 3, 4, 5, 1, 2, 3, 4, 5)
    
    all.letWhile(_ <= 3).lp    // Prints ~(1, 2, 3)
    Definition Classes
    _Class_filter
  70. def lookupOpt[B](f: PartialFunction[A, B]): Opt[B]

    Find first matching option

    Find first matching option

    The matching element is mapped with the functions

    def stream = ~[Any] + "ABC" + 1 + 22.0 + "DE" + 333F + "F"
    
    // Find length of the first matching string
    stream.lookupOpt{
      case s: String if (s.length > 1) => s.length
    }.lp    // Prints: Opt(3)
    Definition Classes
    _Class_evaluate_evaluate
  71. def map[B](f: Mapping[A, B])(implicit i: Ilk[B]): Stream[B]

    Element conversion

    Element conversion

    Converts every element in the pipeline with given function

    (1 <> 5).all.map( _ / 2.0).lp
    
    // Output
    ~(0.5, 1.0, 1.5, 2.0, 2.5)
    Definition Classes
    _Class_map_map
  72. def mapIdx[B](f: Mapping.Idx[A, B], start: Int = 0)(implicit arg0: Ilk[B]): Stream[B]

    Indexed element conversion

    Indexed element conversion

    Converts every element in the pipeline with given function

    f

    the conversion function which also accepts element index in the sequence

    start

    the starting value of indexing

    Definition Classes
    _Class_map
    Example:
    1. ('A' <> 'G').all.mapIdx(_ + "=" + _, 1).lp
      
      // Output
      ~(1=A, 2=B, 3=C, 4=D, 5=E, 6=F, 7=G)
  73. def mapRef[B](f: Mapping[A, B])(implicit i: Ilk[B]): Stream[B]

    Non - specialized mapping

    Non - specialized mapping

    Logically same as map, mapRef will box primitives if they are involved

    Should be rarely used for testing and special cases

    Definition Classes
    _Class_map
  74. def mapType[B]: Stream[B]

    Element cast

    Element cast

    Casts the pipeline elements into the type specified

    def all: ~[Any] = 1 ~+ 2 + 3
    
    all.mapType[Int].lp // Prints: ~(1, 2, 3)
    Definition Classes
    _Class_map_map
    Note

    If there is a problem for element casting, it will come up later during pumping action

  75. def max(implicit c: Ordering[A]): A

    Largest

    Largest

    Selects maximum element, based on the Ordering

    Fails for empty stream

    ~.*(4, 3, 12, 7).maxOpt.lp // Prints: 12
    Definition Classes
    _Class_aggregate
  76. def maxBy[B](f: Mapping[A, B])(implicit arg0: Ordering[B]): A

    Largest by property

    Largest by property

    Selects maximum element, based on mapping

    Fails for empty stream

    ("AA" ~+ "B" + "CCCC" + "DDD").maxBy(_.length).lp // Prints: CCCC
    Definition Classes
    _Class_aggregate
  77. def maxByOpt[B](f: Mapping[A, B])(implicit arg0: Ordering[B]): Opt[A]

    Largest by property option

    Largest by property option

    Selects maximum element, based on mapping

    ("AA" ~+ "B" + "CCCC" + "DDD").maxBy(_.length).lp // Prints: Opt(CCCC)
    Definition Classes
    _Class_aggregate_aggregate
  78. def maxOpt(implicit o: Ordering[A]): Opt[A]

    Largest

    Largest

    Selects maximum element, based on the Ordering

    ~.*(4, 3, 12, 7).maxOpt.lp // Prints: Opt(12)
    Definition Classes
    _Class_aggregate_aggregate
  79. def min(implicit c: Ordering[A]): A

    Smallest

    Smallest

    Selects minimal element, based on the Ordering

    Fails for empty stream

    (4 ~+ 3 + 12 + 7).minOpt.lp // Prints: 3
    Definition Classes
    _Class_aggregate
  80. def minBy[B](f: Mapping[A, B])(implicit arg0: Ordering[B]): A

    Smallest by property

    Smallest by property

    Selects minimal element, based on mapping

    Fails for empty stream

    ("AA" ~+ "B" + "CCCC" + "DDD").minBy(_.length).lp // Prints: B
    Definition Classes
    _Class_aggregate
  81. def minByOpt[B](f: Mapping[A, B])(implicit arg0: Ordering[B]): Opt[A]

    Smallest by property option

    Smallest by property option

    Selects minimal element, based on mapping

    ("AA" ~+ "B" + "CCCC" + "DDD").minBy(_.length).lp // Prints: Opt(B)
    Definition Classes
    _Class_aggregate_aggregate
  82. def minOpt(implicit o: Ordering[A]): Opt[A]

    Smallest

    Smallest

    Selects minimal element, based on the Ordering

    (4 ~+ 3 + 12 + 7).minOpt.lp // Prints: Opt(3)
    Definition Classes
    _Class_aggregate_aggregate
  83. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  84. def next: A

    Next element

    Next element

    Delivers next element

    Fails if no elements

    Implemented as:

    def next: A = if (prime) pump else Stream.failEmpty
    Definition Classes
    _Class_Trait
  85. def nextOpt: Opt[A]

    Next element

    Next element

    Optionally returns next element or Opt.Void

    Definition Classes
    _Class_Trait
  86. final def notify(): Unit
    Definition Classes
    AnyRef
  87. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  88. def parallel: Stream.Flow[A]

    Parallel

    Parallel

    Returns Stream.Flow with parallel execution

    Each consecutive element will be sent to a new thread for processing

    (1 <> 5).all.parallel.peek("Value: " +  _ + "\t" + App.Thread.name lp).drain
    
    // Output
    Value: 1    ForkJoinPool.commonPool-worker-9
    Value: 3    ForkJoinPool.commonPool-worker-11
    Value: 2    main
    Value: 4    ForkJoinPool.commonPool-worker-2
    Value: 5    ForkJoinPool.commonPool-worker-4
    Definition Classes
    _Class_flow
  89. def parallelIf(boolean: Boolean): Stream.Flow[A]

    Conditionally parallel

    Conditionally parallel

    Switches to parallel execution if boolean parameter == true

    Returns Stream.Flow, which could be implemented as sequential Stream or parallel Stream.Flow

    (1 <> 50).all.parallelIf(true).isParallel.lp   // Prints: true
    
    (1 <> 50).all.parallelIf(false).isParallel.lp  // Prints: false
    Definition Classes
    _Class_flow
  90. def parallelIfOver(threshold: Int): Stream.Flow[A]

    Conditionally parallel

    Conditionally parallel

    Switches to parallel execution if number of elements exceeds threshold

    Returns Stream.Flow, which could be implemented as sequential Stream or parallel Stream.Flow

    (1 <> 50).all.parallelIfOver(100).isParallel.lp   // Prints: false
    
    (1 <> 200).all.parallelIfOver(100).isParallel.lp  // Prints: true
    Definition Classes
    _Class_flow
  91. def partition(groupFilters: Filter[A]*): Stream[~[A]]

    Multi-filter grouping

    Multi-filter grouping

    All stream elements are grouped by specified filters

    Filters are applied in sequence, thus if an element is accepted into a group, it will not be evaluated by the rest of the filters

    If there are elements, which are left without a group, one extra group is created

    groupFilters

    a set of filters, to specify groups

    Definition Classes
    _Class_group
    Example:
    1. // Age groups
      (1 <> 80).all.partition(_ <= 12, 13 <> 19, _ < 30, 30 <> 40, _ < 50, _ < 65).tp
      
      // Output
      -------------------------------------------------------------------
      ?
      -------------------------------------------------------------------
      ~(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
      ~(13, 14, 15, 16, 17, 18, 19)
      ~(20, 21, 22, 23, 24, 25, 26, 27, 28, 29)
      ~(30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40)
      ~(41, 42, 43, 44, 45, 46, 47, 48, 49)
      ~(50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64)
      ~(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80)
      -------------------------------------------------------------------
  92. def peek(f: Consumer[A]): Stream[A]

    Element access

    Element access

    Provides access to passing pipeline elements

    This method does not change pipeline type or composition in any way

    ('A' <> 'C').all.peek("Passing: " + _ lp).count.lp
    
    // Output
    Passing: A
    Passing: B
    Passing: C
    3
    Definition Classes
    _Class_peek_peek
  93. def peekIdx(f: Consumer.Idx[A], start: Int = 0): Stream[A]

    Indexed element access

    Indexed element access

    Provides access to passing pipeline elements with their index in sequence

    start

    starting value for element indexing

    ('A' <> 'C').all.peekIdx("Peek" + _ + " = " + _ lp).count.lp
    
    // Output
    Peek 0 = A
    Peek 1 = B
    Peek 2 = C
    3
    Definition Classes
    _Class_peek_peek
  94. def preview: Stream[A] with Stream.Preview[A]

    Adds preview capabilities

    Adds preview capabilities

    Preview allows to pre load and inspect elements, even before they go through Stream

    Definition Classes
    _Class_flow
  95. abstract def prime: Boolean

    Get next element ready

    Get next element ready

    Prepares next element to be pumped. If required, the element might be requested from the source and saved locally

    Returns true if there is element waiting to be pumped or false if Stream is empty

    prime can be called multiple times without pumping the element, in this case it must consistently return the same value

    prime can be used similarly to Iterator.hasNext

    Definition Classes
    _Trait
  96. abstract def pump: A

    Pump next element

    Pump next element

    pump is a faster next

    The Stream MUST be successfully 'primed' before pump is called

    val s : ~[Int] = 1 <> 3
    
    while(s.prime) s.pump.lp
    
    // Prints
    1
    2
    3
    Definition Classes
    _Trait
  97. def range(implicit c: Ordering[A]): Range[A]

    Element Range

    Element Range

    Selects min and max elements (according to the Ordering ), and returns result as Range

    Note. Range is void for empty pipelines.

    (4 ~+ 1 + 12 + 7).range.lp
    
    // Output
    1 <> 12
    Definition Classes
    _Class_aggregate_aggregate
  98. def reduce(op: Folding[A]): A

    Reduces elements with a Folding functions

    Reduces elements with a Folding functions

    Will fail for empty Stream

    Definition Classes
    _Class_aggregate_aggregate
  99. def reduceOpt(op: Folding[A]): Opt[A]

    Reduces elements with a Folding functions

    Reduces elements with a Folding functions

    Returns Opt.Void for for empty Stream

    Definition Classes
    _Class_aggregate_aggregate
  100. def reverse: Stream[A]

    Reverse order

    Reverse order

    Re-arranges elements is reverse order

    Definition Classes
    _Class_flow
  101. def sequential: Stream[A]

    Returns self

    Returns self

    This method is inherited from Stream.Flow, which could be parallel

    In Stream context sequential returns this

    See Stream.Flow.sequential

    Definition Classes
    _Class_flow_flow
  102. def shuffle: Stream[A]

    Randomize order

    Randomize order

    Re-arranges elements is random order

    Note: this operation requires full buffering and is not suitable for large streams

    Definition Classes
    _Class_flow
  103. abstract def sizeOpt: Opt.Int

    Size if known

    Size if known

    Stream elements count if known for granted

    sizeOpt must be trusted

    For example, if sizeOpt returns 0, processing logic should not even attempt to confirm that pipeline is empty

    Definition Classes
    _Trait
  104. def sliding(size: Int, step: Int = 1): Stream[~[A]]

    Sliding group view

    Sliding group view

    Example: group size 3 with step 1

    ('a' <> 'g').all.sliding(3).tp
    
    // Output
    ----------
    ?
    ----------
    ~(a, b, c)
    ~(b, c, d)
    ~(c, d, e)
    ~(d, e, f)
    ~(e, f, g)
    ----------

    Example: group size 4 with step 2

    ('a' <> 'g').all.sliding(4,2).tp
    
    // Output
    -------------
    ?
    -------------
    ~(a, b, c, d)
    ~(c, d, e, f)
    ~(e, f, g)
    -------------
    Definition Classes
    _Class_group
  105. def sort(implicit c: Ordering[A]): Stream[A]

    Sort

    Sort

    Sorts stream elements with provided Ordering

    (5 ~+ 1 + 4 + 2 + 3).sort.lp
    // Output
    ~(1, 2, 3, 4, 5)
    Definition Classes
    _Class_order
  106. def sortBy[B, C, D](f1: Mapping[A, B], f2: Mapping[A, C], f3: Mapping[A, D])(implicit arg0: Ordering[B], arg1: Ordering[C], arg2: Ordering[D]): Stream[A]

    Sort by three properties

    Sort by three properties

    Sorts pipeline on first property, then if indeterminate on second, etc...

    Definition Classes
    _Class_order
  107. def sortBy[B, C](f1: Mapping[A, B], f2: Mapping[A, C])(implicit arg0: Ordering[B], arg1: Ordering[C]): Stream[A]

    Sort by two properties

    Sort by two properties

    Sorts pipeline on first property, and then, if indeterminate on second

    Definition Classes
    _Class_order
  108. def sortBy[B](f: Mapping[A, B])(implicit c: Ordering[B]): Stream[A]

    Sort by property

    Sort by property

    Sorts pipeline on element's property, which is provided by given function

    ~.*("aaaa", "bb", "ccc", "d").sortBy(_.length).lp
    
    // Output
    ~(d, bb, ccc, aaaa)
    Definition Classes
    _Class_order
  109. abstract def sortedByOpt[B]: Opt[(Ordering[B], (A) ⇒ B)]

    Data [Ordering]

    Data [Ordering]

    Data [Ordering] and transition function if elements are sorted

    Definition Classes
    _Trait
  110. abstract def sortedOpt: Opt[Ordering[A]]

    Data [Ordering]

    Data [Ordering]

    Data [Ordering] if elements are sorted

    Definition Classes
    _Trait
  111. def sortReversed(implicit c: Ordering[A]): Stream[A]

    Sort reversed

    Sort reversed

    Sorts pipeline elements with provided Ordering, which is reversed

    (5 ~+ 1 + 4 + 2 + 3).sortReversed.lp
    // Output
    ~(5, 4, 3, 2, 1)
    Definition Classes
    _Class_order
  112. def sum(implicit n: Numeric[A]): A

    Sum

    Sum

    Computes sum value of all elements

    (0 <> 1000).all.sum.lp // Prints: 500500
    Definition Classes
    _Class_aggregate_aggregate
  113. def sumFew[B](f: Mapping[A, B]*)(implicit arg0: Numeric[B]): Idx[B]

    Multi sum

    Multi sum

    Simultaneously computes multiple sum values for properties specified by several functions

    Returns Idx, with values corresponding to the given mappings

    For empty pipelines returned Idx will still hold zero numerics, but will test isVoid positive

    def sum3(stream: ~[Int]): Idx[Int] = stream.sumFew(AS_IS, _ * 10, _ * 100)
    
    sum3(1.I repeat 10).all lp  // Prints: ~(10, 100, 1000)
    
    sum3(\/).all lp             // Prints: ~(0, 0, 0)
    
    sum3(\/).I.Opt lp           // Prints: Opt.Void

    Note: Currently this method is not specialized and will auto box primitives

    Definition Classes
    _Class_aggregate
  114. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  115. def take(cnt: Int): Stream[A]

    Group iterate

    Group iterate

    Iterates through several elements at once and returns them as different Stream

    val s : ~[Int] = 1 <> 30
    
    s.take(5).lp  // Prints ~(1, 2, 3, 4, 5)
    
    s.take(12).lp // Prints ~(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
    
    s.take(7).lp  // Prints ~(18, 19, 20, 21, 22, 23, 24)
    
    // Print leftovers
    s.lp          // Prints ~(25, 26, 27, 28, 29, 30)
    Definition Classes
    _Class_Trait
  116. def to[TRGT[_]](implicit c: Stream.Interface.To.Converter[TRGT]): TRGT[A]

    Convert to type

    Convert to type

    Converts pipeline elements to the specified target type

    Available targets are defined in Stream.Interface.To$

    • Idx
    • Idx.M
    • Idx.OM
    • Idx.I
    • scala.List
    • scala.Seq
    • scala.IndexedSeq
    • scala.Iterator
    • scala.Vector
    • scala.collection.mutable.Buffer
    • java.util.Collection
    • java.util.List
    • java.util.Iterator
    • java.util.Spliterator
    • java.util.stream.Stream
    ("1" ~+ "2" + "3").to[Idx.I]  // Returns: Idx.I[String]
    
    ('A' <> 'D').all.to[List]        // Returns: scala.List[Char]
    
    (1 <> 5).all.to[java.util.List]  // Returns: java.util.List[Int]

    New target conversions can be implemented by creating implicit object extending Stream.Interface.To$.Converter

    Definition Classes
    _Class_convert
  117. def toArray(implicit ct: ClassTag[A]): Array[A]

    Convert to Array

    Convert to Array

    Concert stream to array

    val a : Array[Int] =  (1<>10).all.toArray
    Definition Classes
    _Class_convert
  118. def toBuffer: Stream[A]

    New buffered stream

    New buffered stream

    Buffers all elements from the source and returns them as new Stream

    Definition Classes
    _Class_convert
  119. def toInfo: Pro.Info

    Metadata as String

    Metadata as String

    ('a' <> 'z').all.let(_ > 'X').map(_.toUpper).toInfo.lp
    
    // Output
    
    Stream.Z.extend.map.toChar$Default$4{ilk=Chars,chainDepth=3,preIterate=333}
    Definition Classes
    _Trait
  120. def toInfoTree: Pro.Info.Tree

    Metadata for all transformations

    Metadata for all transformations

    ('a' <> 'z').all.let(_ > 'X').map(_.toUpper).toInfoTree.lp
    
    // Output
    Stream.Z.extend.map.toChar$Default$4{ilk=Chars,chainDepth=3,preIterate=333}
        Stream.Z.extend.filter.apply$$anon$3{ilk=Chars,chainDepth=2,preIterate=500}
            Number.Z.Range$mcC$sp$$anon$2{ilk=Chars,size=26,indexed,chainDepth=1,preIterate=ALL}
    Definition Classes
    _Trait
  121. def toLookup[KEY, VAL](implicit ev: <:<[A, (KEY, VAL)]): Lookup[KEY, VAL]

    New Lookup

    New Lookup

    This Stream must contain tuples of keys and values

    Definition Classes
    _Class_convert
  122. def toLookup[KEY](key: (A) ⇒ KEY): Lookup[KEY, A]

    New Lookup

    New Lookup

    Creates a Lookup collection out of Stream elements

    Definition Classes
    _convert
  123. def toRaw[TRGT](implicit c: Stream.Interface.To.Primitive.Converter[A, TRGT]): TRGT

    Convert to immutable collection

    Convert to immutable collection

    Converts pipeline to the specified immutable collection

    The types of collection and Stream must match

    Available targets are:

    (1 <> 10).all.toRaw[Ints]
    
    ('A' <> 'D').all.toRaw[Chars]
    Definition Classes
    _Class_convert
  124. def toString(): String

    Elements as String

    Elements as String

    Returns String starting with "~(" and containing all elements separated by ", "

    (1 <> 5).all.toString.lp
    
    // Output
    ~(1, 2, 3, 4, 5)
    Definition Classes
    _Class_convert → AnyRef → Any
  125. def toString(name: String): String

    Elements as String

    Elements as String

    Returns String starting with given name and containing all elements separated by ", "

    (1 <> 5).all.toString("My Ints").lp
    
    // Output
    My Ints(1, 2, 3, 4, 5)
    Definition Classes
    _convert
  126. def toText: String

    Elements as multi-line String

    Elements as multi-line String

    Returns all elements as String formatted table

    If elements implement Any.Able.ToInfo, each 'info' property value is placed in a different column

    If elements implement scala.Product (like all Tuples), each Product element is placed in a different column

    ('a' <> 'e').all.map(c => (c + "1", c + "2", c + "3", c + "4", c + "5")) tp
    
    // Output
    -- -- -- -- --
    ?  ?  ?  ?  ?
    -- -- -- -- --
    a1 a2 a3 a4 a5
    b1 b2 b3 b4 b5
    c1 c2 c3 c4 c5
    d1 d2 d3 d4 d5
    e1 e2 e3 e4 e5
    -- -- -- -- --
    Definition Classes
    _Class_convertToText
  127. def toVals(implicit c: Any.Datum.Setup[A]): Vals[A]

    Convert to Vals

    Convert to Vals

    Stores all elements as Vals immutable collection

    Only works if Stream holds Any.Datum type

    Definition Classes
    _Class_convert
  128. def transpose[B](implicit f: Mapping[A, ~[B]]): Stream[~[B]]

    Transpose

    Transpose

    Transposes matrix where rows become columns

    def all: ~[~[Int]] = ~.*(11 <> 15, List(21, 22, 23, 24, 25), Vector(31, 32, 33, 34, 35))
    
    all.toText.lp
    
    all.transpose.toText.lp
    
    // Output
    ---------------------
    ?
    ---------------------
    ~(11, 12, 13, 14, 15)
    ~(21, 22, 23, 24, 25)
    ~(31, 32, 33, 34, 35)
    ---------------------
    
    -------------
    ?
    -------------
    ~(11, 21, 31)
    ~(12, 22, 32)
    ~(13, 23, 33)
    ~(14, 24, 34)
    ~(15, 25, 35)
    -------------
    Definition Classes
    _Class_flow
  129. def triggerEmpty(f: ⇒ Unit): Stream[A]

    Run for empty

    Run for empty

    Runs the given function if pipeline is empty

    Note: This method might not execute for some pumping methods, if they determine that pipeline is empty from the Stream._info, and would not even attempt to pump elements. Please, test

    Definition Classes
    _Class_trigger
  130. def triggerEvery(time: Duration, f: (Int, Duration) ⇒ Unit): Stream[A]

    Run on timer

    Run on timer

    Runs given function every time period, while elements are being pumped

    Note, it will not run even once if all elements pumped in less than the given time length

    time

    period to run

    f

    function with cumulative element count and time length as arguments

    Definition Classes
    _Class_trigger
  131. def triggerFirst(f: (Time) ⇒ Unit): Stream[A]

    Runs before first

    Runs before first

    Runs given function when the first element pumped, but before it is passed down the pipeline

    This will not run for empty pipeline

    f

    Function with current time as argument

    Definition Classes
    _Class_trigger
  132. def triggerLast(f: (Int, Duration) ⇒ Unit): Stream[A]

    Runs after last

    Runs after last

    Runs given function when pumping for the next element brings nothing

    This will not run for empty pipeline

    f

    Function with element count and the Duration it took to pump all elements

    Definition Classes
    _Class_trigger
  133. def unequalOpt(that: ~[A], check: (A, A) ⇒ Boolean = _ == _): Opt[String]

    Unequal check

    Unequal check

    Pumps both streams and compares all corresponding elements

    When first not equal pair is found, message is returned

    If all are equal, Opt.Void is returned

    (0 <> 10).all unequalOpt (0 <> 10) lp        // Prints: Opt.Void
    
    (0 <> 10).all unequalOpt (0 <>> 10) lp       // Prints: Opt(First has more elements)
    
    (0 <> 5).all + 7 + 8 unequalOpt (0 <> 10) lp // Prints: Opt(Fail at index 6: 7 != 6)
    check

    is the function to compare two elements

    Definition Classes
    _Class_evaluate
  134. def unfold(f: Mapping[~[A], A]): Stream[A]

    Lazy infinite stream

    Lazy infinite stream

    Lazily unfolds next value with a function taking all prior values

     // Unfoldifg Fibonacci Sequence
    
    (0 ~+ 1).unfold(_.letLast(2).sum).letNext(20).lp
    
     // Output
     ~(0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181)
    Definition Classes
    _Class_Trait_flow_add
  135. def unzip[B, C](implicit f: (A) ⇒ (B, C)): (Stream[B], Stream[C])

    Unzips stream in two

    Unzips stream in two

    val pairs = ('a' <> 'g').all.zipMap(_.upper).to[Idx]
    
    pairs.all.lp  // Prints ~((a,A), (b,B), (c,C), (d,D), (e,E), (f,F), (g,G))
    
    val (left, right) = pairs.all.unzip
    
    left.all.lp   // Prints ~(a, b, c, d, e, f, g)
    
    right.all.lp  // Prints ~(G, F, E, D, C, B, A)
    Definition Classes
    _Class_zip
  136. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  137. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  138. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  139. final def withFilter(f: Filter[A]): Stream[A]

    For Comprehension hook

    For Comprehension hook

    This method should not be used directly

    It allows Stream to be used in "For Comprehensions"

    Definition Classes
    _Class
  140. def zip[B](that: ~[B]): Stream[(A, B)]

    Zip that

    Zip that

    Merges this and that streams, creating Tuples for corresponding elements

    If that stream runs out of elements to merge, the rest of this stream will be discarded too

    (1 <> 100).all.zip('A' <> 'D').lp
    
    // Output
    ~((1,A), (2,B), (3,C), (4,D))
    Definition Classes
    _Class_zip
  141. def zipAll[B](that: ~[B], thisDflt: Opt[A], thatDflt: Opt[B]): Stream[(A, B)]

    Merge stream

    Merge stream

    Merges this and that streams, creating Tuples for corresponding elements

    that

    the stream to merge with this

    thisDflt

    if this Stream has fewer elements, thisDflt will be used to fill the voids. Fails if thisDflt is required, but not available

    thatDflt

    if that Stream has fewer elements, thatDflt will be used to fill the voids. Fails if thatDflt is required, but not available

    Definition Classes
    _Class_zip
    Example:
    1. ('a' <> 'f').all.zip('A' <> 'H', '?', '?').lp
      
      // Output
      ~((a,A), (b,B), (c,C), (d,D), (e,E), (f,F), (?,G), (?,H))
  142. def zipFoldAs[B](start: B)(f: Folding.As[B, A]): Stream[(A, B)]

    Merges current folding value

    Merges current folding value

    (1 <> 7).all.zipFoldAs(0L)(_ + _).tp
    
    // "Running Total" Output
    -- --
    ?  ?
    -- --
    1  1
    2  3
    3  6
    4  10
    5  15
    6  21
    7  28
    Definition Classes
    _Class_zip
  143. def zipIdx(start: Int): Stream[(Int, A)]

    Merge index

    Merge index

    Creates a new Stream with elements paired with their sequential index

    Note: Idx is the first element in the resulting tuples.

    start

    index initial value

    Definition Classes
    _Class_zip
    Example:
    1.  ('A' <> 'F').all.zipIdx('A'.toInt) lp
      
      // Output
      ~((65,A), (66,B), (67,C), (68,D), (69,E), (70,F))
  144. def zipIdx: Stream[(Int, A)]

    Merge index

    Merge index

    Creates a new Stream with elements paired with their sequential index, starting at 0

    Note: Idx is the first element in the resulting tuples

    ('A' <> 'F').all.zipIdx.lp
    
    // Output
    ~((0,A), (1,B), (2,C), (3,D), (4,E), (5,F))
    Definition Classes
    _Class_zip
  145. def zipMap[B](f: Mapping[A, B]): Stream[(A, B)]

    Merge property

    Merge property

    Creates a new Stream with elements paired with their property, defined by given function

    ('A' <> 'F').all.zipMap(_.toInt).lp
    
    // Output
    ~((A,65), (B,66), (C,67), (D,68), (E,69), (F,70))
    Definition Classes
    _Class_zip
  146. def zipNext: Stream[(A, Opt[A])]

    Merge with next

    Merge with next

    Creates new Stream with elements paired with the optional next element

    (1 <> 5).all.zipNext.lp
    
    // Output
    ~((1,Opt(2)), (2,Opt(3)), (3,Opt(4)), (4,Opt(5)), (5,Void))
    Definition Classes
    _Class_zip
  147. def zipPrior: Stream[(Opt[A], A)]

    Merge with prior

    Merge with prior

    Creates new Stream with elements paired with the optional prior element

    (1 <> 5).all.zipPrior.lp
    
    // Output
    ~((Void,1), (Opt(1),2), (Opt(2),3), (Opt(3),4), (Opt(4),5))
    Definition Classes
    _Class_zip

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(element: A): Stream[A]

    Append

    Append

    Same as append

    Creates a new Stream with given element appended to this Stream

    (1 <> 5).all + 99 + 100 lp
    
    // Output
    ~(1, 2, 3, 4, 5, 99, 100)
    Definition Classes
    _Class_add
  4. def +~(that: ~[A]): Stream[A]

    Append all

    Append all

    Same as appendAll

    Creates a new Stream with that Stream appended to this Stream

    ('1' <> '9').all +~ ('a' <> 'd') +~ ('A' <> 'D') lp
    
    // Output
    ~(1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, A, B, C, D)
    Definition Classes
    _Class_add
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any

Hidden

  1. def _consumeIndexed(f: Consumer[A]): Unit
    Attributes
    protected
    Definition Classes
    _Class
  2. def _pumpIndexed: A
    Attributes
    protected
    Definition Classes
    _Class