Class JoinExpression


  • public class JoinExpression
    extends Expression
    Realizes a VIL join, typically over the variability model configuration and / or a project's artifact model.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • JoinExpression

        public JoinExpression​(JoinVariableDeclaration[] joinVariables,
                              Expression condition)
                       throws VilException
        Creates a new join expression.
        Parameters:
        joinVariables - the join variables (must not be null and must contain at least two variables although a higher number might be not supported)
        condition - the join condition, may be null
        Throws:
        VilException - in case that structural or semantic constraints are not satisfied
    • Method Detail

      • getVariablesCount

        public int getVariablesCount()
        Returns the number of join variables.
        Returns:
        the number of join variables
      • getVariable

        public JoinVariableDeclaration getVariable​(int index)
        Returns the specified join variable.
        Parameters:
        index - the 0-based index denoting the variable to be returned
        Returns:
        the specified join variable
        Throws:
        java.lang.IndexOutOfBoundsException - in case that index < 0 || index >=getVariablesCount()
      • getVisibleVariablesCount

        public int getVisibleVariablesCount()
        Returns the number of visible join variables.
        Returns:
        the number of visible join variables
      • getVisibleVariable

        public JoinVariableDeclaration getVisibleVariable​(int index)
        Returns the specified visible join variable.
        Parameters:
        index - the 0-based index denoting the variable to be returned
        Returns:
        the specified visible join variable
        Throws:
        java.lang.IndexOutOfBoundsException - in case that index < 0 || index >=getVisibleVariablesCount()
      • getCondition

        public Expression getCondition()
        Returns the join condition.
        Returns:
        the join condition (may be empty)
      • 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)