Android Collection Average getLongListAvg(Collection c)

Here you can find the source of getLongListAvg(Collection c)

Description

get Long List Avg

Declaration

public static Long getLongListAvg(Collection<Long> c) 

Method Source Code

//package com.java2s;
import java.util.Collection;

public class Main {

    public static Long getLongListAvg(Collection<Long> c) {
        return getLongListSum(c) / c.size();
    }/*from  www  . j a  v a 2  s  . c  o  m*/

    public static Long getLongListSum(Collection<Long> c) {
        Long sum = 0l;
        for (Long i : c) {
            sum += i;
        }
        return sum;
    }
}

Related

  1. getIntListAvg(Collection c)