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

public class FunctionSet extends OneShotComponent
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 Details

  • Constructor Details

    • FunctionSet

      public FunctionSet()
  • Method Details

    • putIfSet

      protected void putIfSet(String string, Supplier<PostfixMathCommandI> sup)
      Only add the function if the string is not null and does not start with "!" This depends on syntax for missing resource in JepMessages where 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 function
      sup - supplier of the function to add, this is only called if the function is added
    • put

      public void put(String string, PostfixMathCommandI pfmc)
    • firstInit

      public void firstInit(Jep jep)
      Specified by:
      firstInit in class OneShotComponent