Here you can find the source of min(Collection
Parameter | Description |
---|---|
data | a parameter |
public static Double min(Collection<Double> data)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009, 2013, 2014 Matthew Purver, Queen Mary University of London. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html// w w w . j av a2 s . co m ******************************************************************************/ import java.util.Collection; import java.util.Collections; public class Main { /** * @param data * @return the min */ public static Double min(Collection<Double> data) { return Collections.min(data); } /** * @param data * @return the min */ public static double min(double[] data) { double min = Double.POSITIVE_INFINITY; for (double datum : data) { min = Math.min(min, datum); } return min; } }