Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.table.aggregator
Class WeightedSumAggregator

java.lang.Object
  extended by com.citra.pivot.table.aggregator.NumericalAggregator
      extended by com.citra.pivot.table.aggregator.WeightedSumAggregator
All Implemented Interfaces:
StandardMeasureAggregator, TableAggregator

public class WeightedSumAggregator
extends NumericalAggregator
implements StandardMeasureAggregator

WeightedSumAggregator produces a weighted sum over a set of values.


Field Summary
protected  TableMeasure weight
          a measure to use as the weight when summing
 
Fields inherited from class com.citra.pivot.table.aggregator.NumericalAggregator
aggregationType
 
Constructor Summary
WeightedSumAggregator(TableMeasure weight)
          Constructs a WeightedSumAggregator.
WeightedSumAggregator(TableMeasure weight, OlapType type)
          Constructs a WeightedSumAggregator.
 
Method Summary
 MemberList getAggregatedMembers(TableMember currentMember, TableConnection connection, TableMeasure measure)
          Returns the list of members whose values should be aggregated in order to produce the aggregation for currentMember.
 Object getAggregateValue(List queries, TableTuple query, TableConnection connection, TableMeasure measure)
          Determines the aggregate value for a list of member parameters.
 String getName()
          Retrieves the name of the aggregator.
 
Methods inherited from class com.citra.pivot.table.aggregator.NumericalAggregator
getType, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

weight

protected TableMeasure weight
a measure to use as the weight when summing

Constructor Detail

WeightedSumAggregator

public WeightedSumAggregator(TableMeasure weight)
Constructs a WeightedSumAggregator.


WeightedSumAggregator

public WeightedSumAggregator(TableMeasure weight,
                             OlapType type)
Constructs a WeightedSumAggregator.

Method Detail

getAggregatedMembers

public MemberList getAggregatedMembers(TableMember currentMember,
                                       TableConnection connection,
                                       TableMeasure measure)
                                throws DataSourceException
Returns the list of members whose values should be aggregated in order to produce the aggregation for currentMember.

Specified by:
getAggregatedMembers in interface StandardMeasureAggregator
Parameters:
currentMember - the member that is being aggregated
connection - the connection to the table datasource
measure - the measure being aggregated
Returns:
a list of members
Throws:
DataSourceException

getAggregateValue

public Object getAggregateValue(List queries,
                                TableTuple query,
                                TableConnection connection,
                                TableMeasure measure)
                         throws DataSourceException
Determines the aggregate value for a list of member parameters.

Specified by:
getAggregateValue in interface StandardMeasureAggregator
Parameters:
queries - a list of TableTuples
query - the members currently being aggregated
connection - the connection to the table datasource
measure - the measure being aggregated
Returns:
the aggregated value produced
Throws:
DataSourceException

getName

public String getName()
Retrieves the name of the aggregator.

Specified by:
getName in interface TableAggregator
Returns:
the aggregator's name

Copyright © 2011 Citra Technologies. All Rights Reserved.