Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.treetable.db
Class DefaultDatabaseAggregator

java.lang.Object
  extended by com.sciapp.treetable.AbstractAggregator
      extended by com.sciapp.treetable.db.AbstractDatabaseAggregator
          extended by com.sciapp.treetable.db.DefaultDatabaseAggregator
All Implemented Interfaces:
Aggregator, DatabaseAggregator

public class DefaultDatabaseAggregator
extends AbstractDatabaseAggregator

This class returns the value of the column under which the children of the header row are grouped, or an emptry string if the column was not used to group this node's children. It is also assumed that the aggregate rows returned from the database are Object arrays.


Field Summary
 
Fields inherited from class com.sciapp.treetable.db.AbstractDatabaseAggregator
treeModel
 
Constructor Summary
DefaultDatabaseAggregator(DefaultDatabaseTreeTableModel treeModel)
          Constructs a DefaultDatabaseAggregator.
 
Method Summary
 Object getAggregateObject(Object ob, int column)
          Returns the Object found at column of aggregateObject passed as a parameter.
 Object getAggregateValue(AggregateRow row, int columnIndex)
          Calculates and returns the aggregate value for node at columnIndex.
 List getAggregateValues(AggregateRow parent, int from, int to)
          Calculates and returns the aggregate values of the children of parent in the range from - to.
 
Methods inherited from class com.sciapp.treetable.db.AbstractDatabaseAggregator
prepareValues
 
Methods inherited from class com.sciapp.treetable.AbstractAggregator
prepareValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sciapp.treetable.Aggregator
prepareValue
 

Constructor Detail

DefaultDatabaseAggregator

public DefaultDatabaseAggregator(DefaultDatabaseTreeTableModel treeModel)
Constructs a DefaultDatabaseAggregator.

Method Detail

getAggregateObject

public Object getAggregateObject(Object ob,
                                 int column)
Returns the Object found at column of aggregateObject passed as a parameter.

Parameters:
ob - the aggregate object as it was received from the fetch database call
column - the column index
Returns:
an appropriate value for the object at column

getAggregateValue

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

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

getAggregateValues

public List getAggregateValues(AggregateRow parent,
                               int from,
                               int to)
Calculates and returns the aggregate values of the children of parent in the range from - to.

Parameters:
parent - the parent node
from - the index of the first child
to - the index of the last child
Returns:
the aggregate values as a List

Copyright © 2005 Scientific Applications. All Rights Reserved.