Interface FormulaFunction

All Known Implementing Classes:
AbstractVBooleanVBooleanToVBooleanFormulaFunction, AbstractVIntNumberVIntNumberToVIntNumberFormulaFunction, AbstractVNumberArrayVNumberArrayToVNumberArrayFormulaFunction, AbstractVNumberArrayVNumberToVNumberArrayFormulaFunction, AbstractVNumberToVNumberFormulaFunction, AbstractVNumberVNumberArrayToVNumberArrayFormulaFunction, AbstractVNumberVNumberToVBooleanFormulaFunction, AbstractVNumberVNumberToVNumberFormulaFunction

public interface FormulaFunction
Definition for a function that can be integrated in the formula language.
  • Method Details

    • isVarArgs

      boolean isVarArgs()
      Whether the function takes a variable number of arguments.

      Variable arguments can only be at the end of the argument list, and have the same type.

      Returns:
      true if the function can accept a variable number of arguments
    • getName

      String getName()
      Return the name of the function.
      Returns:
      the function name
    • getDescription

      String getDescription()
      Return the description of the function.
      Returns:
      the function description
    • getArgumentTypes

      List<Class<?>> getArgumentTypes()
      The ordered list of the arguments type.
      Returns:
      the types of the arguments
    • getArgumentNames

      List<String> getArgumentNames()
      The ordered list of the argument names.
      Returns:
      the names of the names
    • getReturnType

      Class<?> getReturnType()
      The type of the function result.
      Returns:
      the result type
    • calculate

      Object calculate(List<Object> args)
      Calculate the result of the function given the arguments.
      Parameters:
      args - the argument list
      Returns:
      the result of the function
    • latestValidTimeOrNowOf

      default Time latestValidTimeOrNowOf(List<Object> args)
      Returns the time with latest valid timestamp or now.
      Parameters:
      args - a list of values
      Returns:
      the latest time; can't be null
    • highestSeverityOf

      default Alarm highestSeverityOf(List<Object> args, boolean considerNull)
      Returns the alarm with highest severity. null values can either be ignored or treated as UNDEFINED severity.
      Parameters:
      args - a list of values
      considerNull - whether to consider null values
      Returns:
      the highest alarm; can't be null