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

public static double calculateColumnTotal ( Values2D data , int column , int [ ] validRows ) { ParamChecks . nullNotPermitted ( data , "data" ) ; double total = 0.0 ; int rowCount = data . getRowCount ( ) ; for ( int v = 0 ; v < validRows . length ; v ++ ) { int row = validRows [ v ] ; if ( row < rowCount ) { Number n = data . getValue ( row , column ) ; if ( n != null ) { total += n . doubleValue ( ) ; } } } return total ; }
returns the total of the values in one column of the supplied data table by taking only the row numbers in the array into account .
