public static class EvalSpice.SimpleEq
extends java.lang.Object
For a simple equation to be valid, it must define both operands and an operator. However, if the operator is '-', then the left hand operand may be null, to indicate a unary minus. Additionally, if only the left hand operator is defined, then it is simply one operand.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
lhop |
protected java.lang.Object |
rhop |
| Constructor and Description |
|---|
EvalSpice.SimpleEq() |
EvalSpice.SimpleEq(java.lang.Object lhop,
EvalSpice.Op op,
java.lang.Object rhop) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentifier(java.lang.Object id) |
boolean |
addIdentifierOk() |
void |
addOp(EvalSpice.Op operator) |
java.lang.Object |
eval()
Return either a Double, if the equation can be
resolved numerically, or a String representing
the equation after any numerical resolution can be done.
|
public EvalSpice.SimpleEq()
public EvalSpice.SimpleEq(java.lang.Object lhop,
EvalSpice.Op op,
java.lang.Object rhop)
public boolean addIdentifierOk()
public void addIdentifier(java.lang.Object id)
throws EvalSpice.ParseException
EvalSpice.ParseExceptionpublic void addOp(EvalSpice.Op operator) throws EvalSpice.ParseException
EvalSpice.ParseExceptionpublic java.lang.Object eval()
throws EvalSpice.ParseException
EvalSpice.ParseException