de.hakenadu.terms.visitor.eval.SimpleEvaluationVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of composite-terms Show documentation
Show all versions of composite-terms Show documentation
A light extensible java 8+ library for creating composites of terms which are evaluatable using a visitor pattern.
The newest version!
package de.hakenadu.terms.visitor.eval;
import java.util.HashMap;
import java.util.Map;
import de.hakenadu.terms.Variable;
public class SimpleEvaluationVisitor extends EvaluationVisitor {
private final Map variableValues = new HashMap<>();
@Override
public void visit(final Variable variable, final EvaluationContext context) {
context.setValue(variableValues.get(variable.getName()));
}
public final Map getVariableValues() {
return variableValues;
}
}