Package com.singularsys.jep.misc
Class FunctionSet
java.lang.Object
com.singularsys.jep.misc.OneShotComponent
com.singularsys.jep.misc.FunctionSet
- All Implemented Interfaces:
JepComponent,Serializable
- Direct Known Subclasses:
ChainableFunctionSet,ChainedFunctionSet,LambdaFunctionSet,StreamFunctionSet,StringFunctionSet
Holds a set of functions. These functions can be added to the main Jep function table
by including the set in the Jep constructor.
Jep jep = new Jep(new StringFunctionSet());,
or by calling jep.setComponent(new StringFunctionSet());.
Both add string functions to Jep
Since Jep 4.1 this class is a OneShotComponent
and the functions are added once to the Jep instance.
This prevents conflicts with manually adding functions.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidput(String string, PostfixMathCommandI pfmc) protected voidputIfSet(String string, Supplier<PostfixMathCommandI> sup) Only add the function if the string is not null and does not start with "!"Methods inherited from class com.singularsys.jep.misc.OneShotComponent
getLightWeightInstance, init
-
Field Details
-
functions
-
-
Constructor Details
-
FunctionSet
public FunctionSet()
-
-
Method Details
-
putIfSet
Only add the function if the string is not null and does not start with "!" This depends on syntax for missing resource inJepMessageswhere the key !property.name! is returned if the resource is missing.- Parameters:
string- the name of the function to add or string starting with "!" to omit the functionsup- supplier of the function to add, this is only called if the function is added
-
put
-
firstInit
- Specified by:
firstInitin classOneShotComponent
-