com.g2forge.alexandria.expression.eval.IEvaluator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ax-expression Show documentation
Show all versions of ax-expression Show documentation
A library for expressions and their evaluation. Includes a basic implementation for math.
package com.g2forge.alexandria.expression.eval;
import java.util.function.Supplier;
import com.g2forge.alexandria.expression.ExpressionNotEvaluableException;
import com.g2forge.alexandria.expression.IEnvironment;
import com.g2forge.alexandria.expression.IExpression;
import com.g2forge.alexandria.expression.IVariable;
import com.g2forge.alexandria.java.close.ICloseable;
import com.g2forge.alexandria.java.function.IFunction2;
public interface IEvaluator, N extends IEnvironment, E extends IExpression> {
public E apply(E expression, N environment, Supplier supplier);
public E apply(String description, E expression, N environment);
public ICloseable debug();
public T eval(E expression, Class type, Supplier supplier) throws ExpressionNotEvaluableException;
public T eval(String description, E expression, Class type, IFunction2 super E, ? super Class, ? extends T> function) throws ExpressionNotEvaluableException;
public E reduce(E expression, Supplier supplier);
public E reduce(String description, E expression);
}