Hello, I often develop JTableModels in which some cells must contain the result of a simple, simple mathematical formula. These formulas may have:
- Operators (+, -, *, /)
- Numeric constants
- Other cell references (containing numbers)
- Parameters (numbers with a reference name of type "INTEREST_RATE")
I often allow this to be done by a small class of calculator that analyzes the formula, which syntax I define. The calculator class uses the stack for calculations, and the syntax always uses Polish notation.
But the Polish notation is unnatural for me and for my users. So my question is ...
Is there a lib that works in 1.5 jvm and can handle my requests and use normal notation (with brackets, I don't know the name of this notation style) for formulas?
PD suggested that formulas are always syntactically correct, and I can preprogram numbers that are not constants to provide their values
source share