1 8 package org.lsmp.djep.xjep.function; 9 10 import java.util.*; 11 import org.nfunk.jep.*; 12 import org.nfunk.jep.function.*; 13 14 20 public class Min extends SumType { 21 22 static Comparative comp = new Comparative(Comparative.LE); 23 24 public Min() 25 { 26 super("Min"); 27 } 28 29 30 public Object evaluate(Object elements[]) throws ParseException 31 { 32 Object ret; 33 ret = elements[0]; 34 for(int i=1;i<elements.length;++i) 35 { 36 if(comp.lt(elements[i],ret)) 37 ret = elements[i]; 38 } 39 return ret; 40 } 41 } 42 | Popular Tags |