Package org.yamcs.studio.data.formula
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 Summary
Modifier and TypeMethodDescriptionCalculate the result of the function given the arguments.The ordered list of the argument names.The ordered list of the arguments type.Return the description of the function.getName()
Return the name of the function.Class<?>
The type of the function result.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.boolean
Whether the function takes a variable number of arguments.default Time
latestValidTimeOrNowOf
(List<Object> args) Returns the time with latest valid timestamp or now.
-
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
The ordered list of the arguments type.- Returns:
- the types of the arguments
-
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
Calculate the result of the function given the arguments.- Parameters:
args
- the argument list- Returns:
- the result of the function
-
latestValidTimeOrNowOf
Returns the time with latest valid timestamp or now.- Parameters:
args
- a list of values- Returns:
- the latest time; can't be null
-
highestSeverityOf
Returns the alarm with highest severity. null values can either be ignored or treated as UNDEFINED severity.- Parameters:
args
- a list of valuesconsiderNull
- whether to consider null values- Returns:
- the highest alarm; can't be null
-