Class CaseExpression

    • Constructor Detail

      • CaseExpression

        public CaseExpression​(Expression expression,
                              List when,
                              List then)
        Constructor for CaseExpression objects
        Parameters:
        expression - a non-null expression
        when - a non-null List containing at least one Expression
        then - a non-null List containing at least one Expression
    • Method Detail

      • getExpression

        public Expression getExpression()
        Gets the expression whose evaluation is being tested in this case expression.
        Returns:
      • setExpression

        public void setExpression​(Expression expr)
        Sets the expression for this case expression
        Parameters:
        expr - a non-null Expression
      • getWhen

        public List getWhen()
        Gets the List of Expressions in the WHEN parts of this expression. Never null.
        Returns:
      • getWhenExpression

        public Expression getWhenExpression​(int index)
        Gets the WHEN expression at the given 0-based index.
        Parameters:
        index -
        Returns:
      • setWhen

        public void setWhen​(List when,
                            List then)
        Sets the WHEN and THEN parts of this CASE expression. Both lists should have the same number of Expressions.
        Specified by:
        setWhen in class AbstractCaseExpression
        Parameters:
        when - a non-null List of at least one Expression
        then - a non-null List of at least one Expression
      • acceptVisitor

        public void acceptVisitor​(LanguageVisitor visitor)
        Description copied from interface: LanguageObject
        Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.
        Parameters:
        visitor - Visitor being used