Here you can find the source of meanDoubleList(List
public static double meanDoubleList(List<Double> list)
//package com.java2s; /*/*from w ww.j a v a 2 s . co m*/ * Copyright (c) 2008--2014, The University of Sheffield. See the file * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt * * This file is part of GATE (see http://gate.ac.uk/), and is free * software, licenced under the GNU Library General Public License, * Version 2, June 1991 (in the distribution as file licence.html, * and also available at http://gate.ac.uk/gate/licence.html). * * $Id: Utilities.java 17718 2014-03-20 20:40:06Z adamfunk $ */ import java.util.List; public class Main { public static double meanDoubleList(List<Double> list) { if (list.isEmpty()) { return 0.0; } // implied else double total = 0.0; for (Double item : list) { total += item; } return total / ((double) list.size()); } }