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