Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / SumOfIntScalar

SumOfIntScalar

class SumOfIntScalar : Scalar<Int>

Integer Scalar which sums up the values of other Scalars of the same type

Here is how you can use it to summarize numbers:

val sum = SumOfIntScalar({ 1 }, { 2 }, { 3 }).invoke()

There is no thread-safety guarantee.

Parameters

scalars - Scalars to sum up values from

Since 0.4

Constructors

Name Summary
<init> SumOfIntScalar(vararg scalars: Scalar<Int>)
SumOfIntScalar(vararg scalars: KScalar<Int>)SumOfIntScalar(scalars: Iterable<KScalar<Int>>)
Integer Scalar which sums up the values of other Scalars of the same type

Functions

Name Summary
invoke fun invoke(): Int
Get value of this Scalar