@Test public void testIntegerIfElse() { BooleanExpression condition = new RelationalOperation<>(new IntegerConstant(1), RelationalOperator.LT, new IntegerConstant(2)); IntegerExpression thenBranch = new IntegerConstant(1); IntegerExpression elseBranch = new IntegerConstant(2); ConditionalExpression<Integer> condExpr = new IntegerConditionalExpression(condition, thenBranch, elseBranch); Assert.assertEquals("if 1 < 2 then 1 else 2 endif", condExpr.use()); }
@Override public String use() { return String.format("if %s then %s else %s endif", condition.use(), thenBranch.use(), elseBranch.use()); }
ConditionalExpression implements Expression<T> { @Override public String use() { return String.format("if %s then %s else %s endif", condition.use(), thenBranch.use(), elseBranch.use()); } }
ConditionalExpression implements Expression<T> { @Override public String use() { return String.format("if %s then %s else %s endif", condition.use(), thenBranch.use(), elseBranch.use()); } ConditionalExpression(BooleanExpression condition, Expression<T> thenBranch,
      Expression<T> elseBranch); }
ConditionalExpression implements Expression<T> { @Override public String use() { return String.format("if %s then %s else %s endif", condition.use(), thenBranch.use(), elseBranch.use()); } ConditionalExpression(BooleanExpression condition, Expression<T> thenBranch,
      Expression<T> elseBranch); @Override String use(); @Override Expression<T> substitute(String name, Object value); }
ConditionalExpression implements Expression<T> { @Override public String use() { return String.format("if %s then %s else %s endif", condition.use(), thenBranch.use(), elseBranch.use()); } ConditionalExpression(BooleanExpression condition, Expression<T> thenBranch,
      Expression<T> elseBranch); @Override String use(); @Override Expression<T> substitute(String name, Object value);  }