ExpressionJ is a Java library allowing to interpret simple numeric expressions, which may be used in all applications which have to combine numeric values, but do not want to use full−blown scripting languages.
a+2
Equation equation = ExpressionJ.parse("a+2");Let's evaluate the expression with 1 for the value of
a
: equation.getVariable("a").setValue(1); Object result = equation.eval();The result will be the Integer 3.
Copyright 2018 Herve Girod. All Rights Reserved