public static double calculateColumnTotal(Values2D data,int column){
  ParamChecks.nullNotPermitted(data,"data");
  double total=0.0;
  int rowCount=data.getRowCount();
  for (int r=0; r < rowCount; r++) {
    Number n=data.getValue(r,column);
    if (n != null) {
      total+=n.doubleValue();
    }
  }
  return total;
}

public static double calculateColumnTotal ( Values2D data , int column ) { ParamChecks . nullNotPermitted ( data , "data" ) ; double total = 0.0 ; int rowCount = data . getRowCount ( ) ; for ( int r = 0 ; r < rowCount ; r ++ ) { Number n = data . getValue ( r , column ) ; if ( n != null ) { total += n . doubleValue ( ) ; } } return total ; }
returns the total of the values in one column of the supplied data table .
