Java Utililty Methods List Sum

List of utility methods to do List Sum

Description

The list of methods to do List Sum are organized into topic(s).

Method

doublesumOfSquares(List list)
sum Of Squares
double accum = 0;
for (T item : list) {
    accum = accum + (item.doubleValue() * item.doubleValue());
return accum;
intsumTerms(List terms)
Sum a list of integers.
int sum = 0;
for (Integer term : terms)
    sum += term;
return sum;
doublesumUp(final List list)
Sums up the elements in the list.
assert null != list;
double result = 0;
final Iterator<Double> iter = list.iterator();
while (iter.hasNext()) {
    final Double next = iter.next();
    if (null != next) {
        result += next.doubleValue();
return result;
longsumWithDivide(List okaylist, int curdiv)
sum With Divide
long t = 0L;
for (int oneokay : okaylist) {
    t += (oneokay > curdiv ? (oneokay / curdiv) : 1);
return t;