package com.changhong.epc.parsing.service.autosubmit.tool.function;
|
|
import java.util.Map;
|
|
import com.googlecode.aviator.runtime.function.AbstractFunction;
|
import com.googlecode.aviator.runtime.type.AviatorDouble;
|
import com.googlecode.aviator.runtime.type.AviatorObject;
|
|
import com.changhong.epc.parsing.service.autosubmit.info.FormCpn;
|
import com.changhong.epc.parsing.service.autosubmit.tool.FormCpnTool;
|
|
/**
|
* 汇总函数
|
* @author WangYX
|
*
|
*/
|
public class Sum extends AbstractFunction{
|
|
@Override
|
public String getName() {
|
return "SUM";
|
}
|
|
@Override
|
public AviatorObject call(Map<String, Object> env, AviatorObject cpnKey) {
|
Object cpnObj = cpnKey.getValue(env);
|
if(!(cpnObj instanceof FormCpn))
|
return new AviatorDouble(0);
|
return new AviatorDouble(FormCpnTool.sumValByCpn((FormCpn) cpnObj));
|
}
|
|
}
|