KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > reportcalculator > AverageStrategy


1 package com.calipso.reportgenerator.reportcalculator;
2
3 import com.calipso.reportgenerator.common.InfoException;
4
5 import java.io.Serializable JavaDoc;
6
7 /**
8  *
9  * User: jbassino
10  * Date: 08/11/2004
11  * Time: 14:22:23
12  *
13  */

14 public class AverageStrategy extends MetricCalculationStrategy implements Serializable JavaDoc {
15   private SumStrategy decoratedStrategy;
16
17   public AverageStrategy(){
18     this.decoratedStrategy = new SumStrategy();
19   }
20
21   public Object JavaDoc operate(Object JavaDoc[] node, int index, Object JavaDoc measure, Object JavaDoc[] aRow) {
22     return decoratedStrategy.operate(node, index, measure, aRow);
23   }
24
25   public String JavaDoc getSQLFunction() throws InfoException {
26     return BasicSQLConstants.SUM;
27   }
28
29 }
30
Popular Tags