com.ff.JEvaluator
Class JEvaluator

java.lang.Object
  extended bycom.ff.JEvaluator.JEvaluator

public class JEvaluator
extends java.lang.Object

Author:
fiorucci

Constructor Summary
JEvaluator()
           
JEvaluator(java.lang.String varEqualsExpr)
          Creates an evaluator from an expression such as "varName=expr"
JEvaluator(java.lang.String varName, java.lang.String expr)
           
 
Method Summary
 boolean delVar(java.lang.String varName)
          Deletes a variable for the current evaluator instance
 void dump(java.lang.String varName)
           
 java.lang.String getVar(java.lang.String varName)
          Gets a variable's value for the current evaluator instance
 boolean init(java.lang.String configFile)
           
 boolean isFunctionRegistered(BaseFunctionInterface f)
          Checks to see whether a function was registered
 boolean isFunctionRegistered(java.lang.String functionName)
          Checks to see whether a function was registered
 boolean isVarDefined(java.lang.String varName)
          Checks to see whether varName is defined for the current evaluator instance
 void registerFunction(BaseFunctionInterface f)
          Registers a customized function to JEvaluator
 boolean setExpr(java.lang.String expression)
          Sets a variable's value for the current evaluator instance, based on an expression in the format "varName=expression"
 boolean setVar(java.lang.String varName, java.lang.String expr)
          Sets a variable's value for the current evaluator instance
 void unregisterFunction(BaseFunctionInterface f)
          Unregisters a customized function to JEvaluator
 boolean unregisterFunction(java.lang.String functionName)
          Unregisters a customized function to JEvaluator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEvaluator

public JEvaluator()

JEvaluator

public JEvaluator(java.lang.String varName,
                  java.lang.String expr)

JEvaluator

public JEvaluator(java.lang.String varEqualsExpr)
Creates an evaluator from an expression such as "varName=expr"

Parameters:
varEqualsExpr -
Method Detail

init

public boolean init(java.lang.String configFile)

dump

public void dump(java.lang.String varName)

setExpr

public boolean setExpr(java.lang.String expression)
Sets a variable's value for the current evaluator instance, based on an expression in the format "varName=expression"

Parameters:
expression - the expression in the format "varName=expression"
Returns:
false if varName was newly created, false in case varName's previous value was overridden

setVar

public boolean setVar(java.lang.String varName,
                      java.lang.String expr)
Sets a variable's value for the current evaluator instance

Parameters:
varName - the variable's name
expr - the value/expression to set
Returns:
false if varName was newly created, false in case varName's previous value was overridden

getVar

public java.lang.String getVar(java.lang.String varName)
                        throws java.lang.Exception
Gets a variable's value for the current evaluator instance

Parameters:
varName - the variable name
Returns:
the variable value
Throws:
java.lang.Exception

delVar

public boolean delVar(java.lang.String varName)
Deletes a variable for the current evaluator instance

Parameters:
varName - the variable name
Returns:
true if deletion was successful, false otherwise (variable not found)

isVarDefined

public boolean isVarDefined(java.lang.String varName)
Checks to see whether varName is defined for the current evaluator instance

Parameters:
varName - the variable's name
Returns:
true is varName is defined, false otherwise

registerFunction

public void registerFunction(BaseFunctionInterface f)
Registers a customized function to JEvaluator

Parameters:
f - the Function object to register

unregisterFunction

public void unregisterFunction(BaseFunctionInterface f)
Unregisters a customized function to JEvaluator

Parameters:
f - the Function object to unregister

unregisterFunction

public boolean unregisterFunction(java.lang.String functionName)
Unregisters a customized function to JEvaluator

Parameters:
functionName - the Function object to unregister
Returns:
true if unregistration was successful, false otherwise

isFunctionRegistered

public boolean isFunctionRegistered(BaseFunctionInterface f)
Checks to see whether a function was registered

Parameters:
f - the function object
Returns:
true if function was registered, false otherwise

isFunctionRegistered

public boolean isFunctionRegistered(java.lang.String functionName)
Checks to see whether a function was registered

Parameters:
functionName - the function name
Returns:
true if function was registered, false otherwise