【文件属性】:
文件名称:逆波兰式表达式计算引擎
文件大小:5KB
文件格式:RAR
更新时间:2017-11-30 04:11:15
逆波兰式计算
逆波兰式表达式计算引擎
ReversePolishExpression Tool V1.0.1 Feature
1.Attention! the input expression isn't allowed to constants Invalid Characters like '_、#'
2.It's supported the calculation of div(/) mod(%) sqrt(_) mul(*) sub(-) pow(^)
3.The Usage:
there is needly two HashMap .One as the input paramters and another was put into the
first HashMap for passing the expression's values.The parent HashMap contains lots of placeholders,
just like the 'AA'、'BB'、'CC' see the example code below.
eg.
HashMap maps = new HashMap();
HashMap kvmap = new HashMap();
maps.put("expression", "(((AA*-BB)*CC+(AA*-BB)/CC)+((AA*(-BB))*CC+(AA*-BB)%CC))");
kvmap.put("AA", 4);
kvmap.put("BB", 2);
kvmap.put("CC", 9);
maps.put("kvmap", kvmap);
System.out.println("使用工具结果:"+ReversePolishExpression.calculateExpression(maps));
【文件预览】:
字符串表达式计算引擎
----PolishExpression.jar(5KB)
----使用说明.txt(917B)