Java List Sum getSum(List values)

Here you can find the source of getSum(List values)

Description

Returns the sum of the given values.

License

Open Source License

Parameter

Parameter Description
values the values.

Return

the sum.

Declaration

public static Double getSum(List<Double> values) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /**//from  www.j a  v a  2  s  .  com
     * Returns the sum of the given values.
     * 
     * @param values the values.
     * @return the sum.
     */
    public static Double getSum(List<Double> values) {
        Double sum = 0.0;

        for (Double value : values) {
            if (value != null) {
                sum += value;
            }
        }

        return sum;
    }
}

Related

  1. checkSum(List stringList)
  2. getListSum(List list)
  3. getResidualSumOfSquares(List response, List samples, int ta)
  4. getSum(final List values)
  5. getSum(List numList)
  6. getSum(List longList)
  7. getSumOfInts(List ints)
  8. getSumOfPositiveDoubles(List scores)
  9. removeOne(List summary, int start)