Package nz.org.riskscape.engine.function
Class BinaryPredicateFunction<T,U>
java.lang.Object
nz.org.riskscape.engine.function.BinaryPredicateFunction<T,U>
- Type Parameters:
T
- the type of the lhs of the predicateU
- the type of the rhs of the predicate
- All Implemented Interfaces:
AutoCloseable
,RiskscapeFunction
,UntypedFunction
Convenience for adding RiskscapeFunction
metadata to a java BiPredicate
function
-
Field Summary
Fields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
BUILT_IN
-
Constructor Summary
ConstructorDescriptionBinaryPredicateFunction
(TokenTypes operation, Class<T> lhsJavaType, Type lhsType, Class<U> rhsJavaType, Type rhsType, BiPredicate<T, U> predicate) -
Method Summary
Modifier and TypeMethodDescriptionExecute the function with the given arguments.toString()
static <T> BinaryPredicateFunction<T,
T> uniform
(TokenTypes operation, Type type, Class<T> javaType, BiPredicate<T, T> predicate) static BinaryPredicateFunction<Object,
Object> untyped
(TokenTypes operation, Type lhs, Type rhs, BiPredicate<Object, Object> predicate) 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
-
BinaryPredicateFunction
public BinaryPredicateFunction(TokenTypes operation, Class<T> lhsJavaType, Type lhsType, Class<U> rhsJavaType, Type rhsType, BiPredicate<T, U> predicate)
-
-
Method Details
-
untyped
public static BinaryPredicateFunction<Object,Object> untyped(TokenTypes operation, Type lhs, Type rhs, BiPredicate<Object, Object> predicate) -
uniform
public static <T> BinaryPredicateFunction<T,T> uniform(TokenTypes operation, Type type, Class<T> javaType, BiPredicate<T, T> predicate) -
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
-
getPredicate
-
getLhsJavaType
-
getRhsJavaType
-
getArgumentTypes
- Specified by:
getArgumentTypes
in interfaceRiskscapeFunction
- Returns:
- the types that this function expects
-
getLhsType
-
getRhsType
-
getReturnType
- Specified by:
getReturnType
in interfaceRiskscapeFunction
- Returns:
- the type that this function should return
-