1 package com.calipso.reportgenerator.reportcalculator; 2 3 import com.calipso.reportgenerator.common.InfoException; 4 5 import java.io.Serializable ; 6 7 14 public class AverageStrategy extends MetricCalculationStrategy implements Serializable { 15 private SumStrategy decoratedStrategy; 16 17 public AverageStrategy(){ 18 this.decoratedStrategy = new SumStrategy(); 19 } 20 21 public Object operate(Object [] node, int index, Object measure, Object [] aRow) { 22 return decoratedStrategy.operate(node, index, measure, aRow); 23 } 24 25 public String getSQLFunction() throws InfoException { 26 return BasicSQLConstants.SUM; 27 } 28 29 } 30 | Popular Tags |