|
http://www.eteks.com | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eteks.parser.node.ConditionNode
Node matching a condition.
Constructor Summary | |
ConditionNode()
|
Method Summary | |
void |
addParameter(ExpressionNode parameter)
Stores the if, then and else expressions of this condition. |
double |
computeExpression(double[] parametersValue)
Returns the computed value of then or else expressions depending on the computed value of the if expression. |
java.lang.Object |
computeExpression(Interpreter interpreter,
java.lang.Object[] parametersValue)
Returns the result of this condition. |
ExpressionNode |
getElseExpression()
Returns the node matching the else expression. |
ExpressionNode |
getIfExpression()
Returns the node matching the if expression. |
int |
getParameterCount()
Returns the current count of parameters or operands stored by this node. |
ExpressionNode |
getThenExpression()
Returns the node matching the then expression. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConditionNode()
Method Detail |
public void addParameter(ExpressionNode parameter)
addParameter
in interface ParameterizedNode
com.eteks.parser.node.ParameterizedNode
parameter
- the node of an expression used as parameter or operand.public int getParameterCount()
ParameterizedNode
getParameterCount
in interface ParameterizedNode
com.eteks.parser.node.ParameterizedNode
public ExpressionNode getIfExpression()
public ExpressionNode getThenExpression()
public ExpressionNode getElseExpression()
public java.lang.Object computeExpression(Interpreter interpreter, java.lang.Object[] parametersValue)
supportsRecursiveCall ()
method of the interpreter
returns true
, the computed value of then or else expressions
is returned depending on whether the isTrue ()
method of the interpreter
returning true
or not. The computed value of the if expression
is passed as parameter to the isTrue ()
method.supportsRecursiveCall ()
method returns false
,
this method returns the result of the getConditionValue ()
method of interpreter
with the computed value of the if, then
and else expressions as parameters.computeExpression
in interface ExpressionNode
interpreter
- runtime interpreter.parametersValue
- the value of parameters passed to compute a compiled function.Interpreter.isTrue(java.lang.Object)
,
Interpreter.getConditionValue(java.lang.Object, java.lang.Object, java.lang.Object)
public double computeExpression(double[] parametersValue)
ConstantNode.FALSE_DOUBLE
.computeExpression
in interface ExpressionNode
parametersValue
- the value of parameters passed to compute a compiled function.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |