public class TrivialExample3
extends java.lang.Object
The techniques in this example are useful when only a few variables are used. See TrivailExample2 for a class using evaluate(var) where var is an array of values for all 26 variables. TrivialExample uses techniques suitable when only the "common" variables t, x, and y are used.
To evaluate prefix or postfix expressions, simply replace "buildFromInfix" by "buildFromPrefix" or "buildFromPostfix".
Requires:
ExprEvaluator.java
EasyFormat.java
DoubleScanner.java
| Constructor and Description |
|---|
TrivialExample3()
Constructor for TrivialExample3.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args)
Trivial main program that starts the application.
|