afreechart/src/main/java/org/afree/data/DataUtilities.java
/**
     * Returns the total of the values in one row of the supplied data
     * table by taking only the column numbers in the array into account.
     *
     * @param data  the table of values (<code>null</code> not permitted).
     * @param row  the row index (zero-based).
     * @param validCols the array with valid cols (zero-based).
     *
     * @return The total of the valid values in the specified row.
     *
     * @since JFreeChart 1.0.13
     */
Returns the total of the values in one row of the supplied data
table by taking only the column numbers in the array into account.

@param data  the table of values (null not permitted).
@param row  the row index (zero-based).
@param validCols the array with valid cols (zero-based).

@return The total of the valid values in the specified row.


Returns the total of the values in one row of the supplied data table by taking only the column numbers in the array into account . @param data the table of values ( null not permitted ) . @param row the row index ( zero - based ) . @param validCols the array with valid cols ( zero - based ) . @return The total of the valid values in the specified row .
public static double calculateRowTotal(Values2D data, int row,
             int[] validCols) {
        if (data == null) {
            throw new IllegalArgumentException("Null 'data' argument.");
        }
        double total = 0.0;
        int colCount = data.getColumnCount();
        for (int v = 0; v < validCols.length; v++) {
            int col = validCols[v];
            if (col < colCount) {
                Number n = data.getValue(row, col);
                if (n != null) {
                    total += n.doubleValue();
                }
            }
        }
        return total;
    }
public static double calculateRowTotal ( Values2D data , int row , int [ ] validCols ) { if ( data == null ) { throw new IllegalArgumentException ( "Null 'data' argument." ) ; } double total = 0.0 ; int colCount = data . getColumnCount ( ) ; for ( int v = 0 ; v < validCols . length ; v ++ ) { int col = validCols [ v ] ; if ( col < colCount ) { Number n = data . getValue ( row , col ) ; if ( n != null ) { total += n . doubleValue ( ) ; } } } return total ; }
Returns the total of the values in one row of the supplied data
 table by taking only the column numbers in the array into account.
Returns the total of the values in one row of the supplied data table by taking only the column numbers in the array into account .