net.sourceforge.jeval.function.string
Class Eval

java.lang.Object
  extended by net.sourceforge.jeval.function.string.Eval
All Implemented Interfaces:
Function

public class Eval
extends java.lang.Object
implements Function

This class is a function that executes within Evaluator. The function returns the result of a Evaluator compatible expression. See the Evaluator.evaluate(String) method for a complete description of how this function works.


Constructor Summary
Eval()
           
 
Method Summary
 java.lang.String execute(Evaluator evaluator, java.lang.String arguments)
          Executes the function for the specified argument.
 java.lang.String getName()
          Returns the name of the function - "eval".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Eval

public Eval()
Method Detail

getName

public java.lang.String getName()
Returns the name of the function - "eval".

Specified by:
getName in interface Function
Returns:
The name of this function class.

execute

public java.lang.String execute(Evaluator evaluator,
                                java.lang.String arguments)
                         throws FunctionException
Executes the function for the specified argument. This method is called internally by Evaluator.

Specified by:
execute in interface Function
Parameters:
evaluator - An instance of evaluator.
arguments - A string expression that is compatible with Evaluator. *** THE STRING ARGUMENT SHOULD NOT BE ENCLOSED IN QUOTES OR THE EXPRESSION MAY NOT BE EVALUATED CORRECTLY.*** *** FUNCTION CALLS ARE VALID WITHIN THE EVAL FUNCTION. ***
Returns:
The evaluated result fot the input expression.
Throws:
FunctionException - Thrown if the argument(s) are not valid for this function.


Copyright (C) 2002-2007 Robert Breidecker.