Commit c435aa7a authored by yanzg's avatar yanzg

打印模板处理

parent 2a87ba80
......@@ -3,16 +3,13 @@ package helper;
import com.yanzuoguang.util.helper.CalcHelper;
import org.junit.Test;
public class TestCalcHelper implements CalcHelper.CalcParameter {
public class TestCalcHelper {
@Test
public void test() {
System.out.println(CalcHelper.calc("2 * ( a + b * d )",this));
}
System.out.println(CalcHelper.calc("2 * ( a + b * d )", new CalcHelper.CalcParameter() {
@Override
public double getValue(String parameterName) {
System.out.println("参数名:" +parameterName);
switch (parameterName){
case "a":
return 5;
......@@ -24,4 +21,6 @@ public class TestCalcHelper implements CalcHelper.CalcParameter {
return 0;
}
}
}));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment