Java List Sum sumWithDivide(List okaylist, int curdiv)

Here you can find the source of sumWithDivide(List okaylist, int curdiv)

Description

sum With Divide

License

Open Source License

Declaration

private static long sumWithDivide(List<Integer> okaylist, int curdiv) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    private static long sumWithDivide(List<Integer> okaylist, int curdiv) {
        long t = 0L;

        for (int oneokay : okaylist) {
            t += (oneokay > curdiv ? (oneokay / curdiv) : 1);
        }/*from  w w w .  j a v a  2s .  c o  m*/

        return t;
    }
}

Related

  1. sumLong(List list)
  2. sumOfSquares(List samples)
  3. sumOfSquares(List list)
  4. sumTerms(List terms)
  5. sumUp(final List list)