Java List Average averageValue(List oper)

Here you can find the source of averageValue(List oper)

Description

average Value

License

Open Source License

Declaration

public static Number averageValue(List<? extends Number> oper) 

Method Source Code


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

public class Main {

    public static Number averageValue(List<? extends Number> oper) {
        double avg = 0.0;
        for (int i = 0, j = oper.size(); i < j; i++) {
            avg += oper.get(i).doubleValue();
        }//  ww  w.  j a  va 2s .c  o  m
        return avg / oper.size();
    }
}

Related

  1. average(List numbers)
  2. average(List observations)
  3. average(List collection)
  4. averageDouble(final List values)
  5. averageLog(List logList)
  6. calculateAverage(final List durations)
  7. calculateAverage(List list)
  8. computeAverage(List aList)
  9. getAverage(int period, List timeline)