Kactoos

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

SumOfLongScalar

class SumOfLongScalar : Scalar<Long>

Long 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 = SumOfLongScalar({ 1L }, { 2L }, { 3L }).invoke()

There is no thread-safety guarantee.

Parameters

scalars - Scalars to sum up values from

Since 0.4

Constructors

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

Functions

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