Package nz.org.riskscape.engine.function
Class BinaryOperatorFunction<T>
java.lang.Object
nz.org.riskscape.engine.function.BinaryOperatorFunction<T>
- All Implemented Interfaces:
AutoCloseable
,RiskscapeFunction
,UntypedFunction
Convenience RiskscapeFunction
for adding metadata to a java BinaryOperator
function, specifically meant for a riskscape language BinaryOperation
-
Field Summary
Fields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
BUILT_IN
-
Constructor Summary
ConstructorDescriptionBinaryOperatorFunction
(TokenTypes operation, BinaryOperator<T> operator, Class<T> javaType) BinaryOperatorFunction
(TokenTypes operation, BinaryOperator<T> operator, Class<T> javaType, Type riskscapeType) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
builtin, getAggregationFunction, getArguments, getOverloaded, getRealizable, getTypesFromArguments, identified, identified, isA, setProblemReporter, validate
Methods inherited from interface nz.org.riskscape.engine.function.UntypedFunction
close
-
Constructor Details
-
BinaryOperatorFunction
-
BinaryOperatorFunction
public BinaryOperatorFunction(TokenTypes operation, BinaryOperator<T> operator, Class<T> javaType, Type riskscapeType) - Parameters:
operation
- the corresponding lexing token for the operatoroperator
- the function to calljavaType
- the java type that the operator accepts and returnsriskscapeType
- the riskscape type that the operator accepts and returns
-
-
Method Details
-
call
Description copied from interface:UntypedFunction
Execute the function with the given arguments.
- Specified by:
call
in interfaceUntypedFunction
- Parameters:
args
- list of arguments to the function that should conform to the types inArgumentList.getArgumentTypes()
-
toString
-
getOperation
-
getOperator
-
getJavaType
-
getReturnType
- Specified by:
getReturnType
in interfaceRiskscapeFunction
- Returns:
- the type that this function should return
-
getArgumentTypes
- Specified by:
getArgumentTypes
in interfaceRiskscapeFunction
- Returns:
- the types that this function expects
-