Class FormulaRegistry

java.lang.Object
org.yamcs.studio.data.formula.FormulaRegistry

public class FormulaRegistry extends Object
The registry to add functions that will be used by the formula parser.
  • Constructor Details

    • FormulaRegistry

      public FormulaRegistry()
  • Method Details

    • getDefault

      public static FormulaRegistry getDefault()
      Returns the default formula registry.
      Returns:
      the default registry
    • registerFormulaFunctionSet

      public void registerFormulaFunctionSet(FormulaFunctionSet functionSet)
      Registers a formula set.
      Parameters:
      functionSet - a formula set
    • listFunctionSets

      public Set<String> listFunctionSets()
      Returns the names of all the registered function sets.
      Returns:
      the names of the registered function sets
    • findFunctionSet

      public FormulaFunctionSet findFunctionSet(String name)
      Returns the registered function set with the given name.
      Parameters:
      name - the function set name
      Returns:
      the set or null
    • findFunctions

      public Collection<FormulaFunction> findFunctions(String functionName, Integer nArguments)
      Finds the registered function with the given name and that can accept the given number of arguments.
      Parameters:
      functionName - the name of the function
      nArguments - the number of the arguments
      Returns:
      the matched functions
    • findNamedConstant

      public VType findNamedConstant(String constantName)
      Returns the value of the constant with the given name
      Parameters:
      constantName - the constant name
      Returns:
      the value of the name