Package com.ezylang.evalex.config
Interface FunctionDictionaryIfc
-
- All Known Implementing Classes:
MapBasedFunctionDictionary
public interface FunctionDictionaryIfcA function dictionary holds all the functions, that can be used in an expression.
The default implementation is theMapBasedFunctionDictionary.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddFunction(java.lang.String functionName, FunctionIfc function)Allows to add a function to the dictionary.FunctionIfcgetFunction(java.lang.String functionName)Get the function definition for a function name.default booleanhasFunction(java.lang.String functionName)Check if the dictionary has a function with that name.
-
-
-
Method Detail
-
addFunction
void addFunction(java.lang.String functionName, FunctionIfc function)Allows to add a function to the dictionary. Implementation is optional, if you have a fixed set of functions, this method can throw an exception.- Parameters:
functionName- The function name.function- The function implementation.
-
hasFunction
default boolean hasFunction(java.lang.String functionName)
Check if the dictionary has a function with that name.- Parameters:
functionName- The function name to look for.- Returns:
trueif a function was found orfalseif not.
-
getFunction
FunctionIfc getFunction(java.lang.String functionName)
Get the function definition for a function name.- Parameters:
functionName- The name of the function.- Returns:
- The function definition or
nullif no function was found.
-
-