Kactoos

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

Reduced

class Reduced<out T : Any> : Scalar<T>

Reduce iterable via BiFunc.

Reduced(
{ head, tail -> head + tail },
IterableOf({ 1 }, { 2 }, { 3 }, { 4 })
).invoke()

There is no thread-safety guarantee.

Parameters

T - KScalar type

function - Folding function

items - The scalars

Since 0.3

Constructors

Name Summary
<init> Reduced(function: BiFunc<T, T, T>, items: Iterable<KScalar<T>>)Reduced(function: KBiFunc<T, T, T>, items: Iterable<KScalar<T>>)
Reduce iterable via BiFunc.

Functions

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