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(); //equal to 6
This class implements Scalar
, which throws a checked
Exception
. This may not be convenient in many cases. To make
it more convenient and get rid of the checked exception you can
use UncheckedScalar
or IoCheckedScalar
decorators.
There is no thread-safety guarantee.
Scalar.NoNulls<T>
Constructor and Description |
---|
SumOfIntScalar(Scalar<Integer>... src)
Ctor.
|
@SafeVarargs public SumOfIntScalar(Scalar<Integer>... src)
src
- Varargs of Scalar to sum up values fromCopyright © 2017–2018 Cactoos. All rights reserved.