trait _aggregate[A] extends Stream.Flow._consume._aggregate[A]
- Alphabetic
- Stream._consume._aggregate
- Stream.Flow._consume._aggregate
- scala.AnyRef
- scala.Any
- Hide All
- Show All
- Public
- All
Method
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
average(implicit n: Numeric[A]): A
Average
Average
Computes average
(10 to 15).all.map(_.toFloat).average // Returns 12.5
- Definition Classes
- _aggregate
-
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
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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
-
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
-
def
foldFlowAs[B](start: B)(op: Folding.As[B, A], cf: Folding[B] = null)(implicit arg0: Tag[B]): B
foldAs
- 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
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
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
-
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
-
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
-
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
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Aggregate Interface
All methods fully pump the pipeline