Class IfStatement

    • Constructor Detail

      • IfStatement

        public IfStatement()
    • Method Detail

      • setExpression

        public void setExpression​(Expression expression)
        Parameters:
        expression - The conditional expression.
      • getStatement

        public Statement getStatement()
        Specified by:
        getStatement in interface IIfStatement
        Returns:
        The statement to execute if the conditional expression evaluates to true.
      • setStatement

        public void setStatement​(Statement statement)
        Parameters:
        statement - The statement to execute if the conditional expression evaluates to true.
      • getElseStatement

        public Statement getElseStatement()
        Specified by:
        getElseStatement in interface IIfStatement
        Returns:
        The else statement to execute if the conditional expression evaluates to false.
      • hasElseStatement

        public boolean hasElseStatement()
        Specified by:
        hasElseStatement in interface IIfStatement
        Returns:
        true if this if statement has an else statement.
      • setElseStatement

        public void setElseStatement​(Statement elseStatement)
        Parameters:
        elseStatement - The else statement to execute if the conditional expression evaluates to false.
      • toString

        public String toString()
        Description copied from class: Statement
        Subclasses should return a String representing the parsed statement.
        Specified by:
        toString in class Statement