01: package com.calipso.reportgenerator.reportcalculator;
02:
03: import com.calipso.reportgenerator.common.InfoException;
04:
05: import java.io.Serializable;
06:
07: /**
08: *
09: * User: jbassino
10: * Date: 08/11/2004
11: * Time: 14:22:23
12: *
13: */
14: public class AverageStrategy extends MetricCalculationStrategy
15: implements Serializable {
16: private SumStrategy decoratedStrategy;
17:
18: public AverageStrategy() {
19: this .decoratedStrategy = new SumStrategy();
20: }
21:
22: public Object operate(Object[] node, int index, Object measure,
23: Object[] aRow) {
24: return decoratedStrategy.operate(node, index, measure, aRow);
25: }
26:
27: public String getSQLFunction() throws InfoException {
28: return BasicSQLConstants.SUM;
29: }
30:
31: }
|