csheets.core.formula
Class Literal

java.lang.Object
  extended by csheets.core.formula.Literal
All Implemented Interfaces:
Expression, Serializable
Direct Known Subclasses:
TestCaseParam

public class Literal
extends Object
implements Expression

A literal value in a formula.

Author:
Einar Pehrson
See Also:
Serialized Form

Constructor Summary
Literal(Value value)
          Creates a new literal.
 
Method Summary
 Object accept(ExpressionVisitor visitor)
          Accepts to visit the given expression visitor.
 Value evaluate()
          Evaluates the expression and returns the result.
 Value getValue()
          Returns the value of the literal.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

public Literal(Value value)
Creates a new literal.

Parameters:
value - the value of literal
Method Detail

evaluate

public Value evaluate()
Description copied from interface: Expression
Evaluates the expression and returns the result.

Specified by:
evaluate in interface Expression
Returns:
the result of the evaluation

getValue

public Value getValue()
Returns the value of the literal.

Returns:
the value of the literal

accept

public Object accept(ExpressionVisitor visitor)
Description copied from interface: Expression
Accepts to visit the given expression visitor.

Specified by:
accept in interface Expression
Parameters:
visitor - the visitor

toString

public String toString()
Overrides:
toString in class Object