http://www.eteks.com

com.eteks.parser.node
Interface ExpressionNode

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ParameterizedNode
All Known Implementing Classes:
ConstantNode, ExpressionParameterNode, FunctionParameterNode, LiteralNode

public interface ExpressionNode
extends java.io.Serializable

Interface implemented by the nodes of the tree of a compiled expression. This tree is built during the parsing of a function or of an expression, and is used at interpretation time to get its value. The computeExpression () methods of an instance of ExpressionNode computes the value of a node at interpretation time. One method uses the matching methods of its Interpreter parameter to compute the value of a node, and the other method computes double values directly.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret
See Also:
Interpreter, CompiledFunction, CompiledExpression

Method Summary
 double computeExpression(double[] parametersValue)
          Returns the value of the expression matching this node.
 java.lang.Object computeExpression(Interpreter interpreter, java.lang.Object[] parametersValue)
          Returns the value of the expression matching this node.
 

Method Detail

computeExpression

public java.lang.Object computeExpression(Interpreter interpreter,
                                          java.lang.Object[] parametersValue)
Returns the value of the expression matching this node. This method can return a computed value returned by one of the methods of Interpreter, the value of a parameter of a function stored in the array parametersValue or any other type of value.
Parameters:
interpreter - the runtime interpreter used to compute of the value of the different literals, constants, operators and functions available in the Syntax interface
parametersValue - the value of parameters passed to compute a compiled function.
Returns:
the value of the expression.
See Also:
CompiledFunction

computeExpression

public double computeExpression(double[] parametersValue)
Returns the value of the expression matching this node. This method is implemented to compute directly the double value result of this node operation.
Parameters:
parametersValue - the value of parameters passed to compute a compiled function.
Returns:
the value of the expression.
See Also:
CompiledFunction

&cp; 1998-2003 eTeks - All rights reserved