Location:
Search - java hashmap x
Search list
Description: XML API,将XML结点返回HASHMAP,对于一般配置性XML解析比较方便,也实用-XML API, the XML node to return HASHMAP, the general configuration of XML for Analysis of more convenient, but also practical
Platform: |
Size: 159744 |
Author: xinsoft |
Hits:
Description: java 中没有类似javascript中的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 javascript 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)
Platform: |
Size: 110592 |
Author: duishu |
Hits: