//测试
import java.util.ArrayList;
import java.util.List;
public class JavaScriptTest {
public static void main(String[] args) {
String gs= "(B+D-(A-C)*A)/F";
List all = new ArrayList();
all.add(new MapJ("A","2"));
all.add(new MapJ("B","3"));
all.add(new MapJ("C","4"));
all.add(new MapJ("D","5"));
all.add(new MapJ("F","24"));
JavaScript js = new JavaScript();
Double d = js.getMathValue(all, gs);
if(d==null){
System.out.println(" 无法计算这个表达式 ");
}else{
System.out.println(d*100+"%");
}
gs= "1*6+Math.sqrt(4)+Math.pow(2,3)";
System.out.println(gs+ "= "+js.getMathValue(gs));
}
}