A new ExpValue means parser once tried to calculate ExpValue#expression but something went wrong! (usually a variable is missed), So Parser tries to store the expression in a ExpValue and calculate it again when needed by MathParser#calculate and will set fromExpValue true, i
| 976 | * that's why we use {@link ExpValue}, to make sure there won't be any dynamic variable. |
| 977 | */ |
| 978 | private static class ExpValue { |
| 979 | final String expression, original; |
| 980 | |
| 981 | ExpValue(String expression, String original) { |
| 982 | this.expression = expression; |
| 983 | this.original = original; |
| 984 | } |
| 985 | |
| 986 | public double calculate(MathParser parser) throws MathParserException { |
| 987 | return parser.calculate(expression, original, true); |
| 988 | } |
| 989 | } |
| 990 | |
| 991 | /** |
| 992 | * A simple parser to parse a linear expression, |
nothing calls this directly
no outgoing calls
no test coverage detected