List of utility methods to do List Average
Number | averageValue(List extends Number> oper) average Value double avg = 0.0; for (int i = 0, j = oper.size(); i < j; i++) { avg += oper.get(i).doubleValue(); return avg / oper.size(); |
long | calculateAverage(final List calculate Average long sumNs = 0; for (final Long value : durations) { sumNs += value; return sumNs / durations.size(); |
Double | calculateAverage(List Average of ints in array x. double sum = 0; long N = 0; if (!list.isEmpty()) { for (Double z : list) { if (z != null && !Double.isNaN(z)) { sum += z; N++; return (double) sum / N; return Double.NaN; |
Double | computeAverage(List compute Average Double sum = 0.0; if (aList.size() > 0) { for (Iterator<Double> iterator = aList.iterator(); iterator.hasNext();) { Double double1 = iterator.next(); sum += double1; return sum / aList.size(); } else { ... |
double | getAverage(int period, List average in specified period. if (period > timeline.size()) return -1; double average = 0.0; for (int i = 0; i < period && i < timeline.size(); i++) { double value = timeline.get(i); average += value; average /= period; ... |
double | getAverage(List extends Number> list) Gets the average. Double total = 0.0; for (Number item : list) { total += item.doubleValue(); return total / list.size(); |
Double | getAverage(List Computes list average. Double sumc = 0.0; for (Double num : l) sumc += num; return sumc / l.size(); |
double | getAverage(List get Average double sum = 0d; for (Double d : values) { sum += d; return sum / values.size(); |
Double | getAverage(List Returns the average of the given values. Double sum = getSum(values);
return sum / values.size();
|
double | getAverage(List get Average double sum = 0; for (double d : values) sum += d; return sum / values.size(); |