Algebra equation parser for java
问题 I need a library to be able to parse an equation an give me the result giving the inputs. For example something like this: String equation = "x + y + z"; Map<String, Integer> vars = new HashMap<String, Integer>(); vars.add("x", 2); vars.add("y", 1), vars.add("z", 3); EquationSolver solver = new EquationSolver(equation, vars); int result = solver.getResult(); System.out.println("result: " + result); And evaluates to: 6 Is there any kind of library for java that can do that for me? Thanks 回答1: