http://www.eteks.com

com.eteks.parser.node
Class ExpressionParameterNode

java.lang.Object
  |
  +--com.eteks.parser.node.ExpressionParameterNode
All Implemented Interfaces:
ExpressionNode, java.io.Serializable

public class ExpressionParameterNode
extends java.lang.Object
implements ExpressionNode

Node matching a parameter of a compiled expression.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret
See Also:
Serialized Form

Constructor Summary
ExpressionParameterNode(ExpressionParameter expressionParameter, java.lang.Object parameterKey)
          Creates the node for the parameter of key parameterKey.
 
Method Summary
 double computeExpression(double[] parametersValue)
          Returns the double value returned by the getParameterValue () method of the the ExpressionParameter instance of this parameter and its key as parameter.
 java.lang.Object computeExpression(Interpreter interpreter, java.lang.Object[] parametersValue)
          Returns the value returned by the getParameterValue () method of interpreter with the returned value of getParameterValue () with the key of this parameter as argument of getParameterValue ().
 ExpressionParameter getExpressionParameter()
          Returns the instance of ExpressionParameter able to returns the key of a parameter and its value.
 java.lang.Object getParameterKey()
          Returns the key of this parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionParameterNode

public ExpressionParameterNode(ExpressionParameter expressionParameter,
                               java.lang.Object parameterKey)
Creates the node for the parameter of key parameterKey.
Parameters:
expressionParameter - the instance of ExpressionParameter that will return the value of a parameter depending on its key.
parameterKey - the key of this parameter.
Method Detail

getParameterKey

public java.lang.Object getParameterKey()
Returns the key of this parameter.
Returns:
the key of this parameter.

getExpressionParameter

public ExpressionParameter getExpressionParameter()
Returns the instance of ExpressionParameter able to returns the key of a parameter and its value.
Returns:
an instance of ExpressionParameter.

computeExpression

public java.lang.Object computeExpression(Interpreter interpreter,
                                          java.lang.Object[] parametersValue)
Returns the value returned by the getParameterValue () method of interpreter with the returned value of getParameterValue () with the key of this parameter as argument of getParameterValue ().
Specified by:
computeExpression in interface ExpressionNode
Parameters:
interpreter - runtime interpreter.
parametersValue - not used.
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 returned by the getParameterValue () method of the the ExpressionParameter instance of this parameter and its key as parameter. The getParameterValue () method must return an instance of Number
Specified by:
computeExpression in interface ExpressionNode
Parameters:
parametersValue - not used.
Returns:
the value of this parameter.

&cp; 1998-2003 eTeks - All rights reserved