Logo Search packages:      
Sourcecode: libjfreechart-java version File versions  Download package

static double org::jfree::data::DataUtilities::calculateRowTotal ( Values2D  data,
int  row 
) [inline, static]

Returns the total of the values in one row of the supplied data table.

data the table of values (null not permitted).
row the row index (zero-based).
The total of the values in the specified row.

Definition at line 85 of file DataUtilities.java.

References org::jfree::data::Values2D::getColumnCount(), and org::jfree::data::Values2D::getValue().

        double total = 0.0;
        int columnCount = data.getColumnCount();
        for (int c = 0; c < columnCount; c++) {
            Number n = data.getValue(row, c);
            if (n != null) {
                total += n.doubleValue();   
        return total;

Generated by  Doxygen 1.6.0   Back to index