@TestFactory public Stream<DynamicNode> testEvaluate() throws ExpressionException { List<ExpressionTestCase> testCases = ImmutableList.of( testCase("1 - 2 + 3", 2), testCase("2 + +4", 6), testCase("2 - -4", 6), testCase("2 * -4", -8), testCase("sin(5)", sin(5)), testCase("atan2(3, 4)", atan2(3, 4)), testCase("0 || 5", 5), testCase("2 || 5", 2), testCase("2 && 5", 5), testCase("5 && 0", 0), testCase("false ? 1 : 2", 2), testCase("true ? 1 : 2", 1), testCase("true ? true ? 1 : 2 : 3", 1), testCase("true ? false ? 1 : 2 : 3", 2), testCase("false ? true ? 1 : 2 : 3", 3), testCase("false ? false ? 1 : 2 : 3", 3), testCase("return 1; 0", 1) ); return testCases.stream() .map(testCase -> dynamicTest( testCase.getExpression(), () -> checkTestCase(testCase) )); }
public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); }
Expression implements Cloneable { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } }
Expression implements Cloneable { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } private  Expression(String expression, String... variableNames); private  Expression(String expression, Set<String> variableNames); }
Expression implements Cloneable { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } private  Expression(String expression, String... variableNames); private  Expression(String expression, Set<String> variableNames); static Expression compile(String expression, String... variableNames); double evaluate(double... values); double evaluate(double[] values, int timeout); void optimize(); @Override String toString(); SlotTable getSlots(); ExpressionEnvironment getEnvironment(); void setEnvironment(ExpressionEnvironment environment); Expression clone(); }
Expression implements Cloneable { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } private  Expression(String expression, String... variableNames); private  Expression(String expression, Set<String> variableNames); static Expression compile(String expression, String... variableNames); double evaluate(double... values); double evaluate(double[] values, int timeout); void optimize(); @Override String toString(); SlotTable getSlots(); ExpressionEnvironment getEnvironment(); void setEnvironment(ExpressionEnvironment environment); Expression clone();  }