t
scalqa

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 to 15).all.map(_.toFloat).average  // Returns 12.5
    Definition Classes
    _aggregate
  3. def averageFew[B](f: Mapping[A, B]*)(implicit arg0: Numeric[B]): Seq[B] with Util.Able.Void

    Multi average

    Multi average

    Simultaneously computes multiple average values for properties specified by several functions

    Returns Seq with values corresponding to the given mappings

    For empty pipelines returned Seq will still hold zero numerics, but will test isVoid==true

    (1 to 1000).all.averageFew(v => v, _ * 10, _ * 100).all.lp  // Prints ~(500, 5005, 50050)
    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

    // Multiply every element by next
    
    (1 to 10).all.fold(1)(_ * _)   // Returns 3628800
    start

    seed value to start with

    Definition Classes
    _aggregate_aggregate
  9. def foldAs[B](start: B)(op: Folding.As[B, A])(implicit arg0: Tag[B]): B

    Fold and convert

    Fold and convert

    Folds and converts elements with a binary function

    // Calculate sum of first 1000 Ints
    
    (1 to 1000).all.foldAs[Long](0L)(_ + _) // Returns 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: Tag[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).max // Returns 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) // Returns 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").maxByOpt(_.length).lp // Returns 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 // Returns 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).min  // Returns 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) // Returns 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").minByOpt(_.length) // Returns 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  // Returns 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 Util.Range

    Note. Range is void for empty pipelines.

    (~~[Int] + 4 + 1 + 12 + 7).range  // Returns range from 1 to 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 to 1000).all.sum  // Returns: 500500
    Definition Classes
    _aggregate_aggregate
  28. def sumFew[B](f: Mapping[A, B]*)(implicit arg0: Numeric[B]): Seq[B] with Util.Able.Void

    Multi sum

    Multi sum

    Simultaneously computes multiple sum values for properties specified by several functions

    Returns Seq, with values corresponding to the given mappings

    For empty pipelines returned Seq will still hold zero numerics, but will test isVoid==true

    (1 to 1000).all.sumFew(v => v, _ * 10, _ * 100).all.lp  // Prints ~(500500, 5005000, 50050000)
    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