com.eteks.parser.node
Class FunctionParameterNode
java.lang.Object
|
+--com.eteks.parser.node.FunctionParameterNode
- All Implemented Interfaces:
- ExpressionNode, java.io.Serializable
- public class FunctionParameterNode
- extends java.lang.Object
- implements ExpressionNode
Node matching a parameter of a compiled function.
- Since:
- Jeks 1.0
- Version:
- 1.0
- Author:
- Emmanuel Puybaret
- See Also:
- Serialized Form
Constructor Summary |
FunctionParameterNode(int parameterIndex)
Creates the node for the parameter at index parameterIndex . |
Method Summary |
double |
computeExpression(double[] parametersValue)
Returns the double value of the parameter in parametersValue
at the index returned by getParameterIndex () . |
java.lang.Object |
computeExpression(Interpreter interpreter,
java.lang.Object[] parametersValue)
Returns the value returned by the getParameterValue () method
of interpreter with the parameter in parametersValue
at the index returned by getParameterIndex () as argument of
getParameterValue () . |
int |
getParameterIndex()
Returns the index of this parameter. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FunctionParameterNode
public FunctionParameterNode(int parameterIndex)
- Creates the node for the parameter at index
parameterIndex
.
- Parameters:
parameterIndex
- the index of the parameter.
getParameterIndex
public int getParameterIndex()
- Returns the index of this parameter.
- Returns:
- the index of this parameter.
computeExpression
public java.lang.Object computeExpression(Interpreter interpreter,
java.lang.Object[] parametersValue)
- Returns the value returned by the
getParameterValue ()
method
of interpreter
with the parameter in parametersValue
at the index returned by getParameterIndex ()
as argument of
getParameterValue ()
.
- Specified by:
computeExpression
in interface ExpressionNode
- Parameters:
interpreter
- runtime interpreter.parametersValue
- the value of parameters passed to compute a compiled function.- Returns:
- the interpreted value of this parameter. The type of the returned value
depends on the implementation of the interpreter.
- See Also:
Interpreter.getParameterValue(java.lang.Object)
computeExpression
public double computeExpression(double[] parametersValue)
- Returns the double value of the parameter in
parametersValue
at the index returned by getParameterIndex ()
.
- Specified by:
computeExpression
in interface ExpressionNode
- Parameters:
parametersValue
- the value of parameters passed to compute a compiled function.- Returns:
- the value of the parameter at the index returned by
getParameterIndex ()
.