Skip navigation links

ExpressionJ API

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.

See: Description

Packages 
Package Description
org.expressionj
Contains only a command line class which gives the version and date of this library.
org.expressionj.expr
Contain classes that are used to compute equations.
org.expressionj.expr.parser
Produced by javaCC.
org.expressionj.functions
Contains classes which allows to bind names in the mathematical expressions to regular Java methods.
org.expressionj.model
Contains fundamental classes used for expressions.
org.expressionj.util
Contains several utility classes.
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.

Example

Let's take for example the following numeric expression: a+2
To parse this expression, we will type:
      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.
Skip navigation links

Copyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence