Example usage for org.jfree.data Values2D getRowCount

List of usage examples for org.jfree.data Values2D getRowCount

Introduction

In this page you can find the example usage for org.jfree.data Values2D getRowCount.

Prototype

public int getRowCount();

Source Link

Document

Returns the number of rows in the table.

Usage

From source file:org.jfree.data.DataUtils.java

/**
 * Returns the total of the values in one column of the supplied data
 * table.//from   w w w .  j  a v  a 2s.c  o m
 *
 * @param data  the table of values ({@code null} not permitted).
 * @param column  the column index (zero-based).
 *
 * @return The total of the values in the specified column.
 */
public static double calculateColumnTotal(Values2D data, int column) {
    Args.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;
}

From source file:org.jfree.data.DataUtilities.java

/**
 * Returns the total of the values in one column of the supplied data
 * table./*  w  w  w .  j a v  a 2s.  c o m*/
 *
 * @param data  the table of values (<code>null</code> not permitted).
 * @param column  the column index (zero-based).
 *
 * @return The total of the values in the specified column.
 */
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;
}

From source file:org.jfree.data.DataUtils.java

/**
 * 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.
 *
 * @param data  the table of values ({@code null} not permitted).
 * @param column  the column index (zero-based).
 * @param validRows the array with valid rows (zero-based).
 *
 * @return The total of the valid values in the specified column.
 *
 * @since 1.0.13//www .ja v a2s  .  co  m
 */
public static double calculateColumnTotal(Values2D data, int column, int[] validRows) {
    Args.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;
}

From source file:org.jfree.data.DataUtilities.java

/**
 * 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.
 *
 * @param data  the table of values (<code>null</code> not permitted).
 * @param column  the column index (zero-based).
 * @param validRows the array with valid rows (zero-based).
 *
 * @return The total of the valid values in the specified column.
 *
 * @since 1.0.13/*  w w w . ja  v a2  s .c o  m*/
 */
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;
}

From source file:nl.strohalm.cyclos.controls.reports.statistics.graphs.StatisticalDataProducer.java

/**
 * determines if the legend is shown or not. It is always shown by the pie charts. If a bar or line, then it is shown if there are more than one
 * series to be displayed. This method is read by the jsp.
 * /*from  w w w. j av  a  2 s  . c o m*/
 * @return a jsp readable string which can either be "true" or "false".
 */
public String getShowLegend() {
    if (resultObject.getGraphType() == StatisticalResultDTO.GraphType.PIE) {
        return "true";
    }
    final Values2D values2D = (Values2D) dataset;
    if (values2D.getRowCount() == 1) {
        return "false";
    }
    return "true";
}