jaskell.expression.Parameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaskell-java8 Show documentation
Show all versions of jaskell-java8 Show documentation
This is a utils library for java 8 project.
It include parsec combinators and sql generators library.
package jaskell.expression;
import java.util.Optional;
/**
* TODO
*
* @author mars
* @version 1.0.0
* @since 2020/06/10 18:03
*/
public class Parameter implements Expression {
private final String name;
public Parameter(String name) {
this.name = name;
}
@Override
public double eval(Env env) throws ExpressionException {
Optional value = env.get(name);
if (value.isPresent()) {
return value.get().eval(env);
} else {
throw new ExpressionException(name + " not found");
}
}
@Override
public Expression makeAst() {
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy