Package advancedminmax
Class MinMax
- java.lang.Object
-
- advancedminmax.MinMax
-
public class MinMax extends Object
MinMax.javaImproved Math.min and Math.max from standard java library. This class implements advanced min/max methods that allow an arbitrary number of arguments.
Usage example:
MinMax.min(1,2,-5,...,n); MinMax.min(1.2,2.3,-5.0,...,n.n); MinMax.max(1,2,-5,...,n); MinMax.max(1.2,2.3,-5.0,...,n.n);
- Version:
- 2.0.0
- Author:
- Cristian Sorescu (christian139601@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description MinMax()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Number & Comparable<T>>
Tmax(T... numbers)
Returns the maximum of the given numbers.static <T extends Number & Comparable<T>>
Tmin(T... numbers)
Returns the minimum of the given numbers.
-
-
-
Method Detail
-
min
@SafeVarargs public static <T extends Number & Comparable<T>> T min(T... numbers)
Returns the minimum of the given numbers.- Parameters:
numbers
- The given numbers.- Returns:
- The minimum of the given numbers.
-
max
@SafeVarargs public static <T extends Number & Comparable<T>> T max(T... numbers)
Returns the maximum of the given numbers.- Parameters:
numbers
- The given numbers.- Returns:
- The maximum of the given numbers.
-
-