Search in sources :

Example 1 with NumberValue

use of com.google.visualization.datasource.datatable.value.NumberValue in project uPortal by Jasig.

the class LoginTotalsStatisticsController method createRowValues.

@Override
protected List<Value> createRowValues(LoginAggregation aggr, LoginReportForm form) {
    final int loginCount;
    final int uniqueLoginCount;
    if (aggr == null) {
        loginCount = 0;
        uniqueLoginCount = 0;
    } else {
        loginCount = aggr.getLoginCount();
        uniqueLoginCount = aggr.getUniqueLoginCount();
    }
    if (form.isTotalLogins() && form.isUniqueLogins()) {
        return ImmutableList.<Value>of(//THE ORDER OF RETURNED VALUES HERE MUST MATCH THE ORDER OF THE COLUMNS RETURNED IN getColumnDescriptions
        new NumberValue(uniqueLoginCount), new NumberValue(loginCount));
    } else if (form.isUniqueLogins()) {
        return Collections.<Value>singletonList(new NumberValue(uniqueLoginCount));
    } else {
        return Collections.<Value>singletonList(new NumberValue(loginCount));
    }
}
Also used : NumberValue(com.google.visualization.datasource.datatable.value.NumberValue) Value(com.google.visualization.datasource.datatable.value.Value) NumberValue(com.google.visualization.datasource.datatable.value.NumberValue)

Aggregations

NumberValue (com.google.visualization.datasource.datatable.value.NumberValue)1 Value (com.google.visualization.datasource.datatable.value.Value)1