public final class SumOfIntScalar extends Object implements Scalar<Integer>
Here is how you can use it to summarize numbers:
int sum = new SumOfIntScalar(() -> 1,() -> 2, () -> 3).value();
// sum equal to 6
This class implements Scalar
, which throws a checked
Exception
. Despite that this class does NOT throw a checked
exception.
There is no thread-safety guarantee.
Constructor and Description |
---|
SumOfIntScalar(Scalar<Integer>... src)
Ctor.
|
@SafeVarargs public SumOfIntScalar(Scalar<Integer>... src)
src
- Varargs of Scalar to sum up values fromCopyright © 2017–2019 Cactoos. All rights reserved.