fasseg / exp4j

A tiny math expression evaluator for the Java programming language
http://www.objecthunter.net/exp4j/
Apache License 2.0
495 stars 163 forks source link

Add VariableProvider API, for dynamically providing variable values #115

Open NathanWolf opened 3 years ago

NathanWolf commented 3 years ago

This can be a big performance improvement when dealing with a lot of possible variables but only using a few at a time.

This adds an optional interface called VariableProvider that clients can implement and pass to an Expression. This will allow looking up a variable value on-demand rather than having to set it in advance.