com.github.basking2.sdsai.itrex.functions.DefaultCaseFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdsai-itrex Show documentation
Show all versions of sdsai-itrex Show documentation
An S-Expression inspiried library focused on iterators.
package com.github.basking2.sdsai.itrex.functions;
import com.github.basking2.sdsai.itrex.EvaluationContext;
import com.github.basking2.sdsai.itrex.util.TypeConversion;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* 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 booolean 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.
*/
public class DefaultCaseFunction implements FunctionInterface> {
@Override
public List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy