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 CountStrategy extends MetricCalculationStrategy implements Serializable { 15 16 public Object operate(Object [] node, int index, Object measure, Object [] aRow) { 17 if(Float.isNaN(((SharedFloat)node[index]).floatValue())){ 18 return SharedFloat.newFrom(1); 19 } 20 return ((SharedFloat)node[index]).add(1); 21 } 22 23 public String getSQLFunction() throws InfoException { 24 return BasicSQLConstants.COUNT; 25 } 26 27 } 28 | Popular Tags |