Here you can find the source of max(final Iterable
Parameter | Description |
---|---|
values | a parameter |
public static Double max(final Iterable<Double> values)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from www . ja va2 s . com*/ * Calculates the max of an Array */ public static double max(final double... array) { double max = Double.NEGATIVE_INFINITY; for (final double value : array) { if (max < value) { max = value; } } return max; } /** * Retrieve the max element * * @param values * @return */ public static Double max(final Iterable<Double> values) { Double max = Double.NEGATIVE_INFINITY; for (final Double value : values) { if (max < value) { max = value; } } return max; } }