Jasmine
1.1
Super fast expression and algorithm evaluator
|
Public Member Functions | |
abstract Expression | eval (double...vars) |
Public Member Functions inherited from org.quark.jasmine.AbstractExpression | |
AbstractExpression () | |
Answer | answer () |
long | getBuildTime () |
long | getEvalTime () |
String | infix () |
String | ast () |
String | bytecode () |
Additional Inherited Members | |
Protected Member Functions inherited from org.quark.jasmine.AbstractExpression | |
String | makeInfix (List< Exp > infix) |
String | makeAST (Exp ast) |
String | makeAST (Deque< Exp > ast) |
void | mmakeASTimpl (Exp exp, String tab, StringBuilder sb) |
String | makeByteCode (byte[] b) |
Protected Attributes inherited from org.quark.jasmine.AbstractExpression | |
long | __buildTime |
long | __evalTime |
Answer | __answer |
String | infix |
String | ast |
String | bytecode |
Abstract class for all Expressions.
|
pure virtual |
This method is overridden in the generated class.
This method accepts zero or more values to be used in the expression. They are matched, in order, to the variables found in the expression. For example if the expression is
"4 + h * a / sin(a * b)"
then evaluating the method with
expression.eval(2.1, 6.2, -7.2);
will initialise the variables as
h = 2.1; a = 6.2; b = -7.2;
This method returns 'this' so for example you can chain like this:
expression.eval(2.1, 6.2, -7.2).answer().toDouble();
to get the answer as a float.
vars | the initial values for variables |