Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.tree
Class Aggregator

java.lang.Object
  extended by com.citra.tree.Aggregator
Direct Known Subclasses:
DefaultCellAggregator

public abstract class Aggregator
extends Object

Aggregator calculates and returns values for the aggregate rows of a TreeTable component.


Field Summary
protected  TreeTableModel model
          the associated treetablemodel
 
Constructor Summary
Aggregator(TreeTableModel model)
          Constructs an Aggregator object.
 
Method Summary
abstract  Object getAggregateValue(int rowIndex, int columnIndex)
          Calculates and returns the aggregate value for the row at rowIndex and columnIndex.
 TreeTableModel getModel()
          Returns the associated TreeTableModel instance.
 Object prepare(AggregateRow row, int rowIndex, int columnIndex)
          This method retrieves the aggregate value that was set for the row at rowIndex and columnIndex.
 void setModel(TreeTableModel model)
          Sets model as the TreeTableModel of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected TreeTableModel model
the associated treetablemodel

Constructor Detail

Aggregator

public Aggregator(TreeTableModel model)
Constructs an Aggregator object.

Method Detail

getAggregateValue

public abstract Object getAggregateValue(int rowIndex,
                                         int columnIndex)
Calculates and returns the aggregate value for the row at rowIndex and columnIndex.

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
Returns:
the aggregate value

getModel

public TreeTableModel getModel()
Returns the associated TreeTableModel instance.

Returns:
the TreeTableModel

prepare

public Object prepare(AggregateRow row,
                      int rowIndex,
                      int columnIndex)
This method retrieves the aggregate value that was set for the row at rowIndex and columnIndex. If this value is null, Aggregator.getAggregateValue(int, int) is called in order to calculate it, and the value returned is assigned as the aggregate value of the row via the AggregateRow.setAggregateValue(java.lang.Object, int, int) method. In this way, aggregate values are evaluated only once, in order to avoid manifold operations.

Parameters:
row - the aggregate row
rowIndex - the index of the row
columnIndex - the column of the row
Returns:
the aggregate value of row

setModel

public void setModel(TreeTableModel model)
Sets model as the TreeTableModel of this object.

Parameters:
model - the treetablemodel to assign

Copyright © 2011 Citra Technologies. All Rights Reserved.