Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.table
Class DefaultTableLeafAggregator

java.lang.Object
  extended by com.citra.pivot.table.DefaultTableLeafAggregator
All Implemented Interfaces:
TableLeafAggregator

public class DefaultTableLeafAggregator
extends Object
implements TableLeafAggregator

DefaultTableLeafAggregator is the default TableLeafAggregator implementation. Leaf members are aggregated based on a single column, with the use of an aggregate function, both of which are specified in the class's constructor.


Field Summary
protected  int column
          the single column that is used in the aggregation of the leafs
protected  Functions.Function function
          the aggregate function
 
Constructor Summary
DefaultTableLeafAggregator(int column)
          Constructs a DefaultTableLeafAggregator.
DefaultTableLeafAggregator(int column, Functions.Function function)
          Constructs a DefaultTableLeafAggregator.
 
Method Summary
 Object aggregate(List values, TableMeasure measure)
          Aggregates a list of values for a given measure.
 Object extractValue(List data, TableMeasure measure)
          Extracts the values that will be aggregated for a given measure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

column

protected int column
the single column that is used in the aggregation of the leafs


function

protected Functions.Function function
the aggregate function

Constructor Detail

DefaultTableLeafAggregator

public DefaultTableLeafAggregator(int column)
Constructs a DefaultTableLeafAggregator.


DefaultTableLeafAggregator

public DefaultTableLeafAggregator(int column,
                                  Functions.Function function)
Constructs a DefaultTableLeafAggregator.

Method Detail

aggregate

public Object aggregate(List values,
                        TableMeasure measure)
Aggregates a list of values for a given measure.

Specified by:
aggregate in interface TableLeafAggregator
Parameters:
values - the list of values to aggregate
measure - the measure to aggregate
Returns:
the aggregated result

extractValue

public Object extractValue(List data,
                           TableMeasure measure)
Extracts the values that will be aggregated for a given measure.

Specified by:
extractValue in interface TableLeafAggregator
Parameters:
data - a list of values corresponding to the rows of the underlying table model
measure - the measure for which values are being extracted
Returns:
the value that will be aggregated

Copyright © 2011 Citra Technologies. All Rights Reserved.