http://www.eteks.com

com.eteks.parser.node
Class LiteralNode

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

public class LiteralNode
extends java.lang.Object
implements ExpressionNode

Node matching a literal value. This node stores the value of a literal.

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

Constructor Summary
LiteralNode(java.lang.Object value)
          Creates a node of a literal whose value is value.
 
Method Summary
 double computeExpression(double[] parametersValue)
          Returns the double value of this literal.
 java.lang.Object computeExpression(Interpreter interpreter, java.lang.Object[] parametersValue)
          Returns the value returned by the getLiteralValue () method of interpreter with the stored value of this literal as parameter.
 java.lang.Object getValue()
          Returns the stored value of this literal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiteralNode

public LiteralNode(java.lang.Object value)
Creates a node of a literal whose value is value.
Parameters:
value - the value of the literal.
Method Detail

getValue

public java.lang.Object getValue()
Returns the stored value of this literal.
Returns:
the value of this literal.

computeExpression

public java.lang.Object computeExpression(Interpreter interpreter,
                                          java.lang.Object[] parametersValue)
Returns the value returned by the getLiteralValue () method of interpreter with the stored value of this literal as parameter.
Specified by:
computeExpression in interface ExpressionNode
Parameters:
interpreter - runtime interpreter.
parametersValue - not used.
Returns:
the interpreted value of this literal. The type of the returned value depends on the implementation of the interpreter.
See Also:
Interpreter.getLiteralValue(java.lang.Object)

computeExpression

public double computeExpression(double[] parametersValue)
Returns the double value of this literal.
Specified by:
computeExpression in interface ExpressionNode
Parameters:
parametersValue - not used.
Returns:
the value of this literal.

&cp; 1998-2003 eTeks - All rights reserved