Class CaseFunction
java.lang.Object
com.github.basking2.sdsai.itrex.functions.CaseFunction
- All Implemented Interfaces:
FunctionInterface<List<Object>>
,BiFunction<Iterator<?>,
EvaluationContext, List<Object>>
The CaseFunction takes two arguments and returns two arguments.
CaseFunction takes, first, an expression that yields a boolean.
Second it takes an expression that produces a result.
If the first expression is true, then CaseFunction returns a list of first the true boolean and
then the result of the second expression's evaluation.
If the first expression is false, then CaseFunction returns a list of first the false boolean and
then a null because the second expression will never be fetched, causing evaluation.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(Iterator<?> iterator, EvaluationContext evaluationContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
CaseFunction
public CaseFunction()
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceBiFunction<Iterator<?>,
EvaluationContext, List<Object>>
-