Class InPlaceIfCommand<I extends VariableDeclaration>

  • Type Parameters:
    I - the variable declaration type

    public class InPlaceIfCommand<I extends VariableDeclaration>
    extends InPlaceCommand<I>
    Replaces an in-place if-command/expression within a string/content expression.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • InPlaceIfCommand

        InPlaceIfCommand​(Expression condition)
        Creates an in-place alternative.
        Parameters:
        condition - the condition of the alternative
    • Method Detail

      • getCondition

        public Expression getCondition()
        Returns the condition expression.
        Returns:
        the condition
      • getThenExpressions

        public java.util.List<Expression> getThenExpressions()
        Returns the then expressions.
        Returns:
        the then expressions
      • getElseExpressions

        public java.util.List<Expression> getElseExpressions()
        Returns the else expressions.
        Returns:
        the else expressions, may be null
      • advanceState

        protected void advanceState()
        Description copied from class: InPlaceCommand
        Changes among different states of sub-structures, e.g., then-part and else-part. Override if needed, else the respective call is just ignored.
        Overrides:
        advanceState in class InPlaceCommand<I extends VariableDeclaration>
      • append

        protected void append​(java.util.List<Expression> exprs)
        Description copied from class: InPlaceCommand
        Appends the sub-expressions in parse sequence to exprs leaving out this command as fallback.
        Specified by:
        append in class InPlaceCommand<I extends VariableDeclaration>
        Parameters:
        exprs - the expressions to add the sub-expressions to