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

intaddByteToMessage(final List message, final byte bytevalue, final int checksum)
Add a byte to the message, updating the checksum.
int intChecksum;
intChecksum = checksum;
message.add(bytevalue);
intChecksum += bytevalue;
return (intChecksum);
NumberadjustSumOfSquareValue(List oper, Number adjustedOper1)
adjust Sum Of Square Value
double model = 0.0;
for (int i = 0, j = oper.size(); i < j; i++) {
    model += Math.pow(oper.get(i).doubleValue() - adjustedOper1.doubleValue(), 2);
return model;
doublecalculateSum(List valueList)
Calculates the sum of the values of a given list.
double sum = 0.;
for (double i : valueList) {
    sum = sum + i;
return sum;
longcheckSum(List stringList)
check Sum
long result = 1;
for (String string : stringList) {
    result = (result * PRIME) + checkSum(string);
return result;
IntegergetListSum(List list)
Return sum of all list entries
Integer result = null;
if (list.size() > 0) {
    result = 0;
    for (Integer value : list) {
        result += value;
return result;
...
doublegetResidualSumOfSquares(List response, List samples, int ta)
get Residual Sum Of Squares
if (response.size() != samples.size())
    throw new RuntimeException(
            "response.size() != samples.size() " + response.size() + "," + samples.size());
double rss = 0;
for (int i = 0; i < response.size(); i++)
    rss += Math.pow(response.get(i) - samples.get(i)[ta], 2);
return rss;
doublegetSum(final List values)
get Sum
double sum = 0.0;
if (values == null) {
    return sum;
for (final Double value : values) {
    sum += value;
return sum;
...
longgetSum(List numList)
get Sum
long sum = 0;
if (numList != null) {
    for (Iterator i = numList.iterator(); i.hasNext();) {
        sum += ((Long) i.next()).longValue();
} else {
    sum = -1;
return sum;
DoublegetSum(List values)
Returns the sum of the given values.
Double sum = 0.0;
for (Double value : values) {
    if (value != null) {
        sum += value;
return sum;
longgetSum(List longList)
get Sum
if (longList == null) {
    return 0L;
long sum = 0L;
for (long l : longList) {
    sum += l;
return sum;
...