Class WoolIfCommand.Clause

  • Enclosing class:
    WoolIfCommand

    public static class WoolIfCommand.Clause
    extends Object
    This class models a clause of an if statement. That is the "if" clause or an "elseif" clause.
    • Constructor Detail

      • Clause

        public Clause​(Expression expression,
                      WoolNodeBody statement)
        Constructs a new if clause.
        Parameters:
        expression - the if expression that should be evaluated as a boolean
        statement - the statement that should be output if the expression evaluates to true
    • Method Detail

      • getExpression

        public Expression getExpression()
        Returns the if expression that should be evaluated as a boolean.
        Returns:
        the if expression
      • setExpression

        public void setExpression​(Expression expression)
        Sets the if expression that should be evaluated as a boolean.
        Parameters:
        expression - the if expression
      • getStatement

        public WoolNodeBody getStatement()
        Returns the statement that should be output if the expression evaluates to true.
        Returns:
        the statement
      • setStatement

        public void setStatement​(WoolNodeBody statement)
        Sets the statement that should be output if the expression evaluates to true.
        Parameters:
        statement - the statement