t

Stream._consume._aggregate

trait _aggregate[A] extends Stream.Flow._consume._aggregate[A]

Aggregate Interface

All methods fully pump the pipeline

Self Type
Stream[A]
Ordering
  1. Alphabetic
Inherited
  1. Stream._consume._aggregate
  2. Stream.Flow._consume._aggregate
  3. scala.AnyRef
  4. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  2. def average(implicit n: Numeric[A]): A

    Average

    Average

    Computes average

    (10.0 <> 15.0).all.average.lp // Prints: 12.5
    Definition Classes
    _aggregate
  3. 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
    _aggregate
  4. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  5. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  6. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  8. 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
    _aggregate_aggregate
    Example:
    1. // Multiply every element by next
      
      (1 <> 10).all.fold(1, _ * _).lp   // Prints: 3628800
  9. def foldAs[B](start: B)(op: Folding.As[B, A])(implicit arg0: 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
    _aggregate
  10. 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
    _aggregate_aggregate
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def max(implicit o: 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
    _aggregate
  14. def maxBy[B](f: Mapping[A, B])(implicit o: 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
    _aggregate
  15. def maxByOpt[B](f: Mapping[A, B])(implicit o: 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
    _aggregate_aggregate
  16. def maxOpt(implicit c: Ordering[A]): Opt[A]

    Largest

    Largest

    Selects maximum element, based on the Ordering

    ~.*(4, 3, 12, 7).maxOpt.lp // Prints: Opt(12)
    Definition Classes
    _aggregate_aggregate
  17. def min(implicit o: 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
    _aggregate
  18. def minBy[B](f: Mapping[A, B])(implicit o: 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
    _aggregate
  19. def minByOpt[B](f: Mapping[A, B])(implicit o: 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
    _aggregate_aggregate
  20. def minOpt(implicit c: Ordering[A]): Opt[A]

    Smallest

    Smallest

    Selects minimal element, based on the Ordering

    (4 ~+ 3 + 12 + 7).minOpt.lp // Prints: Opt(3)
    Definition Classes
    _aggregate_aggregate
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  24. 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
    _aggregate_aggregate
  25. 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
    _aggregate_aggregate
  26. 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
    _aggregate_aggregate
  27. def sum(implicit n: Numeric[A]): A

    Sum

    Sum

    Computes sum value of all elements

    (0 <> 1000).all.sum.lp // Prints: 500500
    Definition Classes
    _aggregate_aggregate
  28. 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
    _aggregate
  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
Linear Supertypes
Source: _aggregate.scala