t

Stream._extend

trait _Trait[A] extends Stream.Flow._extend[A] with _add[A] with _filter[A] with _flow[A] with _group[A] with _map[A] with _order[A] with _peek[A] with _trigger[A] with _zip[A]

Self Type
Stream[A]
Ordering
  1. Alphabetic
Inherited
  1. Stream._extend
  2. Stream._extend._zip
  3. Stream._extend._trigger
  4. Stream._extend._peek
  5. Stream._extend._order
  6. Stream._extend._map
  7. Stream._extend._group
  8. Stream._extend._flow
  9. Stream._extend._filter
  10. Stream._extend._add
  11. Stream.Flow._extend
  12. Stream.Flow._extend._peek
  13. Stream.Flow._extend._map
  14. Stream.Flow._extend._flow
  15. Stream.Flow._extend._filter
  16. Stream.Flow._extend.Z.Shared
  17. scala.AnyRef
  18. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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
    _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
    _add
  3. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  4. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  5. def default(element: ⇒ A): ~[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
    _add
  6. 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
    _filter_filter
  7. def dropAll(a: ~[A])(implicit o: Ordering[A] = \/): ~[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
    _filter
    Note

    The operation is very efficient if streams are sorted

  8. def dropAllBy[B](f: Mapping[A, B], a: ~[B])(implicit o: Ordering[B] = \/): ~[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
    _filter
    Note

    The operation is very efficient if streams are sorted

  9. def dropAt(r: Idx.Range): ~[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
    _filter
  10. def dropEverythingIf(b: Boolean): ~[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
    _filter
  11. def dropLast(number: Int): ~[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
    _filter
  12. def dropNext(number: Int): ~[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
    _filter
  13. 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
    _filter_filter
  14. def dropWhile(f: Filter[A]): ~[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
    _filter
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. 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
    _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)
  19. 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
    _map
  20. def group(test: (A, A) ⇒ Boolean, peekSplit: (A, Boolean) ⇒ Any = \/): ~[~[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
    _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)
      ---------------
  21. def group: ~[~[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
    _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)
      ------------
  22. def groupBy(properties: Mapping[A, Any]*): ~[~[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
    _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)
      ~({, |)
      ---------------------------------------------------------------------------------
  23. def groupBySize(size: Int): ~[~[A]]

    Fixed size groups

    Fixed size groups

    Puts consecutive elements into fixed size groups

    size

    of groups. Cannot be less than 1.

    Definition Classes
    _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)
      -------------------------
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  25. def insertAllAt(index: Int, that: ~[A]): ~[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
    _add
    Example:
    1. ('a' <> 'f').all.insertAllAt(3, 'X' <> 'Z').lp
      
      // Output
      ~(a, b, c, X, Y, Z, d, e, f)
  26. def insertAt(index: Int, element: A): ~[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
    _add
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. 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
    _filter_filter
  29. def letAll(that: ~[A])(implicit o: Ordering[A] = \/): ~[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
    _filter
    Note

    The operation is very efficient if streams are sorted

  30. def letAllBy[B](f: Mapping[A, B], that: ~[B])(implicit o: Ordering[B] = \/): ~[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
    _filter
    Note

    The operation is very efficient if streams are sorted

  31. def letAt(r: Idx.Range): ~[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
    _filter
  32. 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
    _filter_filter
  33. def letIdx(f: Filter.Idx[A], start: Int = 0): ~[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
    _filter
  34. def letLast(number: Int): ~[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
    _filter
  35. 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
    _map → Shared
    Note

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

  36. 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
    _map → Shared
  37. def letNext(number: Int): ~[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
    _filter
  38. 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
    _map → Shared
  39. def letWhile(f: Filter[A]): ~[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
    _filter
  40. 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
    _map_map
  41. def mapIdx[B](f: Mapping.Idx[A, B], start: Int = 0)(implicit i: Ilk[B]): ~[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
    _map
    Example:
    1. ('A' <> 'G').all.mapIdx(_ + "=" + _, 1).lp
      
      // Output
      ~(1=A, 2=B, 3=C, 4=D, 5=E, 6=F, 7=G)
  42. def mapRef[B](f: Mapping[A, B])(implicit i: Ilk[B]): ~[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
    _map
  43. 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
    _map_map
    Note

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

  44. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  45. final def notify(): Unit
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  47. 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
    _flow
  48. 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
    _flow
  49. 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
    _flow
  50. def partition(groupFilters: Filter[A]*): ~[~[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
    _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)
      -------------------------------------------------------------------
  51. 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
    _peek_peek
  52. 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
    _peek_peek
  53. 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
    _flow
  54. def reverse: ~[A]

    Reverse order

    Reverse order

    Re-arranges elements is reverse order

    Definition Classes
    _flow
  55. 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
    _flow_flow
  56. def shuffle: ~[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
    _flow
  57. def sliding(size: Int, step: Int = 1): ~[~[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
    _group
  58. def sort(implicit o: Ordering[A]): ~[A]

    Sort

    Sort

    Sorts stream elements with provided Ordering

    (5 ~+ 1 + 4 + 2 + 3).sort.lp
    // Output
    ~(1, 2, 3, 4, 5)
    Definition Classes
    _order
  59. 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]): ~[A]

    Sort by three properties

    Sort by three properties

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

    Definition Classes
    _order
  60. def sortBy[B, C](f1: Mapping[A, B], f2: Mapping[A, C])(implicit arg0: Ordering[B], arg1: Ordering[C]): ~[A]

    Sort by two properties

    Sort by two properties

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

    Definition Classes
    _order
  61. def sortBy[B](f: Mapping[A, B])(implicit o: Ordering[B]): ~[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
    _order
  62. def sortReversed(implicit o: Ordering[A]): ~[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
    _order
  63. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  64. def toString(): String
    Definition Classes
    AnyRef → Any
  65. def transpose[B](implicit f: Mapping[A, ~[B]]): ~[~[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
    _flow
  66. def triggerEmpty(f: ⇒ Unit): ~[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
    _trigger
  67. def triggerEvery(time: Duration, f: (Int, Duration) ⇒ Unit): ~[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
    _trigger
  68. def triggerFirst(f: (Time) ⇒ Unit): ~[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
    _trigger
  69. def triggerLast(f: (Int, Duration) ⇒ Unit): ~[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
    _trigger
  70. def unfold(f: Mapping[~[A], A]): ~[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
    _Trait_flow_add
  71. 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
    _zip
  72. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. def zip[B](that: ~[B]): ~[(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
    _zip
  76. def zipAll[B](that: ~[B], thisDflt: Opt[A], thatDflt: Opt[B]): ~[(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
    _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))
  77. 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
    _zip
  78. def zipIdx(start: Int): ~[(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
    _zip
    Example:
    1.  ('A' <> 'F').all.zipIdx('A'.toInt) lp
      
      // Output
      ~((65,A), (66,B), (67,C), (68,D), (69,E), (70,F))
  79. def zipIdx: ~[(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
    _zip
  80. def zipMap[B](f: Mapping[A, B]): ~[(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
    _zip
  81. def zipNext: ~[(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
    _zip
  82. def zipPrior: ~[(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
    _zip

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(element: A): ~[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
    _add
  4. def +~(that: ~[A]): ~[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
    _add
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any