public final class SumOf extends NumberEnvelope
Here is how you can use it to summarize numbers:
int sum = new SumOf(1, 2, 3, 4).intValue(); long sum = new SumOf(1L, 2L, 3L).longValue(); int sum = new SumOf(numbers.toArray(new Integer[numbers.size()])).intValue();
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 |
---|
SumOf(Double... src)
Ctor.
|
SumOf(Float... src)
Ctor.
|
SumOf(Integer... src)
Ctor.
|
SumOf(Iterable<Number> src)
Ctor.
|
SumOf(Long... src)
Ctor.
|
doubleValue, floatValue, intValue, longValue, value
byteValue, shortValue
public SumOf(Integer... src)
src
- Numberspublic SumOf(Long... src)
src
- Numberspublic SumOf(Double... src)
src
- Numberspublic SumOf(Float... src)
src
- NumbersCopyright © 2017 Cactoos. All rights reserved.