public final class SumOfInt extends ScalarEnvelope<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.
@SafeVarargs public SumOfInt(Scalar<Integer>... src)
src
- Varargs of Scalar to sum up values fromCopyright © 2017–2021 Cactoos. All rights reserved.