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 MaxStrategy extends MetricCalculationStrategy implements Serializable { 15 20 21 22 public Object operate(Object [] node, int index, Object measure, Object [] aRow) { 23 27 SharedFloat sharedFloat = (SharedFloat)node[index]; 28 if (measure!=null){ 29 if(Float.isNaN(sharedFloat.floatValue())){ 30 return measure; 31 } 32 if(sharedFloat.compareTo(measure) >= 0){ 33 return sharedFloat; 34 }else{ 35 return measure; 36 } 37 } else{ 38 return sharedFloat; 39 } 40 } 41 42 public String getSQLFunction() throws InfoException { 43 return BasicSQLConstants.MAX; 44 } 45 46 } 47 | Popular Tags |