文件名称:eval-dist-0.5
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 108kb
- 下载次数:
- 0次
- 提 供 者:
- dui***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
java 中没有类似javascr ipt中的eval()函数,无法直接将动态变化的字符串转换成java执行语句。此文档中提供两个jar包,和其api,使用非常简单。
Example of use:
Expression exp = new Expression("(x + y)/2")
Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>()
variables.put("x", new BigDecimal("4.32"))
variables.put("y", new BigDecimal("342.1"))
BigDecimal result = exp.eval(variables)
System.out.println(result)
-java does not like the javascr ipt eval () function, can not directly change the dynamic execution of string into a java statement. This document provides two jar files, and its api, very simple to use. Example of use: Expression exp = new Expression (" (x+ y)/2" ) Map <String, BigDecimal> variables = new HashMap <String, BigDecimal> () Variables.put (" x" , new BigDecimal (" 4.32" )) variables.put (" y" , new BigDecimal (" 342.1" )) BigDecimal result = exp.eval (variables) System.out . println (result)
Example of use:
Expression exp = new Expression("(x + y)/2")
Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>()
variables.put("x", new BigDecimal("4.32"))
variables.put("y", new BigDecimal("342.1"))
BigDecimal result = exp.eval(variables)
System.out.println(result)
-java does not like the javascr ipt eval () function, can not directly change the dynamic execution of string into a java statement. This document provides two jar files, and its api, very simple to use. Example of use: Expression exp = new Expression (" (x+ y)/2" ) Map <String, BigDecimal> variables = new HashMap <String, BigDecimal> () Variables.put (" x" , new BigDecimal (" 4.32" )) variables.put (" y" , new BigDecimal (" 342.1" )) BigDecimal result = exp.eval (variables) System.out . println (result)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
eval
....\doc
....\...\api
....\...\...\net
....\...\...\...\java
....\...\...\...\....\dev
....\...\...\...\....\...\eval
....\...\...\...\....\...\....\class-use
....\...\...\...\....\...\....\example
....\...\...\...\....\...\....\.......\calculator
....\...\...\...\....\...\....\.......\..........\class-use
....\...\...\resources
....\src
....\srcExamples
....\...........\net
....\...........\...\java
....\...........\...\....\dev
....\...........\...\....\...\eval
....\...........\...\....\...\....\example
....\...........\...\....\...\....\.......\calculator
....\srcTest
....\.......\net
....\.......\...\java
....\.......\...\....\dev
....\.......\...\....\...\eval
....\.......\...\....\...\....\example
....\.......\...\....\...\....\.......\calculator
....\.......\...\....\...\....\test
....\...\net
....\...\...\java
....\...\...\....\dev
....\...\...\....\...\eval
....\LICENSE
....\NOTICE
....\build.xml
....\calculator.jar
....\doc\api\allclasses-frame.html
....\...\...\allclasses-noframe.html
....\...\...\constant-values.html
....\...\...\deprecated-list.html
....\...\...\help-doc.html
....\...\...\index-all.html
....\...\...\index.html
....\...\...\net\java\dev\eval\Expression.html
....\...\...\...\....\...\....\class-use\Expression.html
....\...\...\...\....\...\....\example\calculator\Calculator.html
....\...\...\...\....\...\....\.......\..........\class-use\Calculator.html
....\...\...\...\....\...\....\.......\..........\package-frame.html
....\...\...\...\....\...\....\.......\..........\package-summary.html
....\...\...\...\....\...\....\.......\..........\package-tree.html
....\...\...\...\....\...\....\.......\..........\package-use.html
....\...\...\...\....\...\....\package-frame.html
....\...\...\...\....\...\....\package-summary.html
....\...\...\...\....\...\....\package-tree.html
....\...\...\...\....\...\....\package-use.html
....\...\...\overview-frame.html
....\...\...\overview-summary.html
....\...\...\overview-tree.html
....\...\...\package-list
....\...\...\resources\inherit.gif
....\...\...\stylesheet.css
....\eval-0.5.jar
....\srcExamples\net\java\dev\eval\example\calculator\Calculator.java
....\...........\...\....\...\....\.......\..........\package.html
....\...Test\net\java\dev\eval\example\calculator\CalculatorTest.java
....\.......\...\....\...\....\test\ExpressionTest.java
....\...\net\java\dev\eval\Compiler.java
....\...\...\....\...\....\Expression.java
....\...\...\....\...\....\Operation.java
....\...\...\....\...\....\Operator.java
....\...\...\....\...\....\Tokeniser.java
....\...\...\....\...\....\Type.java
....\...\...\....\...\....\package.html
....\...\overview.html
....\doc
....\...\api
....\...\...\net
....\...\...\...\java
....\...\...\...\....\dev
....\...\...\...\....\...\eval
....\...\...\...\....\...\....\class-use
....\...\...\...\....\...\....\example
....\...\...\...\....\...\....\.......\calculator
....\...\...\...\....\...\....\.......\..........\class-use
....\...\...\resources
....\src
....\srcExamples
....\...........\net
....\...........\...\java
....\...........\...\....\dev
....\...........\...\....\...\eval
....\...........\...\....\...\....\example
....\...........\...\....\...\....\.......\calculator
....\srcTest
....\.......\net
....\.......\...\java
....\.......\...\....\dev
....\.......\...\....\...\eval
....\.......\...\....\...\....\example
....\.......\...\....\...\....\.......\calculator
....\.......\...\....\...\....\test
....\...\net
....\...\...\java
....\...\...\....\dev
....\...\...\....\...\eval
....\LICENSE
....\NOTICE
....\build.xml
....\calculator.jar
....\doc\api\allclasses-frame.html
....\...\...\allclasses-noframe.html
....\...\...\constant-values.html
....\...\...\deprecated-list.html
....\...\...\help-doc.html
....\...\...\index-all.html
....\...\...\index.html
....\...\...\net\java\dev\eval\Expression.html
....\...\...\...\....\...\....\class-use\Expression.html
....\...\...\...\....\...\....\example\calculator\Calculator.html
....\...\...\...\....\...\....\.......\..........\class-use\Calculator.html
....\...\...\...\....\...\....\.......\..........\package-frame.html
....\...\...\...\....\...\....\.......\..........\package-summary.html
....\...\...\...\....\...\....\.......\..........\package-tree.html
....\...\...\...\....\...\....\.......\..........\package-use.html
....\...\...\...\....\...\....\package-frame.html
....\...\...\...\....\...\....\package-summary.html
....\...\...\...\....\...\....\package-tree.html
....\...\...\...\....\...\....\package-use.html
....\...\...\overview-frame.html
....\...\...\overview-summary.html
....\...\...\overview-tree.html
....\...\...\package-list
....\...\...\resources\inherit.gif
....\...\...\stylesheet.css
....\eval-0.5.jar
....\srcExamples\net\java\dev\eval\example\calculator\Calculator.java
....\...........\...\....\...\....\.......\..........\package.html
....\...Test\net\java\dev\eval\example\calculator\CalculatorTest.java
....\.......\...\....\...\....\test\ExpressionTest.java
....\...\net\java\dev\eval\Compiler.java
....\...\...\....\...\....\Expression.java
....\...\...\....\...\....\Operation.java
....\...\...\....\...\....\Operator.java
....\...\...\....\...\....\Tokeniser.java
....\...\...\....\...\....\Type.java
....\...\...\....\...\....\package.html
....\...\overview.html