Class CompositeExpression

    • Field Detail

      • expressionList

        private java.util.List<Expression> expressionList
    • Constructor Detail

      • CompositeExpression

        CompositeExpression()
        Constructor for serialization.
      • CompositeExpression

        public CompositeExpression​(java.util.List<Expression> expressionList)
        Creates a new composite expression.
        Parameters:
        expressionList - a list with expressions
      • CompositeExpression

        public CompositeExpression​(Expression... expressions)
        Creates a new composite expression.
        Parameters:
        expressions - the expressions
    • Method Detail

      • getExpressionsCount

        public int getExpressionsCount()
        Returns the number of expression.
        Specified by:
        getExpressionsCount in interface IExpressionIterator
        Returns:
        the number of expressions
      • getExpression

        public Expression getExpression​(int index)
        Returns the specified expression.
        Specified by:
        getExpression in interface IExpressionIterator
        Parameters:
        index - the 0-based index of the expression
        Returns:
        the expression
        Throws:
        java.lang.IndexOutOfBoundsException - if index<0 || index>=#getExpressionListCount()
      • setExpression

        public void setExpression​(int index,
                                  Expression expr)
        Replaces the specified expression. Handle with care!
        Parameters:
        index - the 0-based index of the expression
        expr - the replacing expression
        Throws:
        java.lang.IndexOutOfBoundsException - if index<0 || index>=#getExpressionListCount()
      • inferType

        public TypeDescriptor<?> inferType()
                                    throws VilException
        Description copied from class: Expression
        Infers the type of this expression including the type of the contained sub-expressions.
        Specified by:
        inferType in class Expression
        Returns:
        the type of this expression
        Throws:
        VilException - in case that inferring the type fails
      • accept

        public java.lang.Object accept​(IExpressionVisitor visitor)
                                throws VilException
        Description copied from class: Expression
        Visits the expression.
        Specified by:
        accept in class Expression
        Parameters:
        visitor - the visitor
        Returns:
        the result of visiting this expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)