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:
  `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:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Map<String,PostfixMathCommandI>`
  `functions`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FunctionSet()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `firstInit(Jep jep)`
  `void`
  `put(String string, PostfixMathCommandI pfmc)`
  `protected void`
  `putIfSet(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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### functions

    protected final Map<String,PostfixMathCommandI> functions

- ## 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`