public final class MaxOf extends NumberEnvelope
Here is how you can use it to find the max of a set of numbers:
int max = new MaxOf(1, 2, 3, 4).intValue(); long max = new MaxOf(1L, 2L, 3L).longValue(); int max = new MaxOf(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 the Unchecked
decorator. Or you may use
IoChecked
to wrap it in an IOException.
There is no thread-safety guarantee.
Unchecked
,
IoChecked
,
Serialized FormConstructor and Description |
---|
MaxOf(Double... src)
Ctor.
|
MaxOf(Float... src)
Ctor.
|
MaxOf(Integer... src)
Ctor.
|
MaxOf(Iterable<Number> src)
Ctor.
|
MaxOf(Long... src)
Ctor.
|
doubleValue, floatValue, intValue, longValue, value
byteValue, shortValue
Copyright © 2017–2020 Cactoos. All rights reserved.