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 Product extends SumType { 21 22 static Multiply mul = new Multiply(); 23 24 public Product() 25 { 26 super("Product"); 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 ret = mul.mul(ret,elements[i]); 37 } 38 return ret; 39 } 40 } 41 | Popular Tags |