|
Aggregators |
Top Previous Next |
Aggregators calculate and return values for the aggregate rows of a TreeTable component. The value for the cell of an aggregate row is calculated with:
public Object getAggregateValue(AggregateRow node, int columnIndex);
Then, the value is assigned on the row with:
public Object prepare(AggregateRow row, int columnIndex);
, which ensures that aggregate values are not calculated repeatedly.
DynamicTreeTableModel defines methods for creating, assigning and retrieving the aggregators:
protected Aggregator createDefaultAggregator();
public void setDefaultAggregator(Aggregator aggregator);
public Aggregator getAggregator(int columnIndex);
public Aggregator getDefaultAggregator();
By default, a DefaultCellAggregator is created which uses the installed TreeTableComparators to calculate the aggregate cell values.