Class ExpressionVersionRestriction

  • All Implemented Interfaces:
    net.ssehub.easy.basics.modelManagement.IVersionRestriction

    public class ExpressionVersionRestriction
    extends java.lang.Object
    implements net.ssehub.easy.basics.modelManagement.IVersionRestriction
    A version expression based on IVML constraints.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ExpressionVersionRestriction

        public ExpressionVersionRestriction​(ConstraintSyntaxTree expr,
                                            DecisionVariableDeclaration versionVariable,
                                            DecisionVariableDeclaration compoundVersionVariable)
                                     throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
        Creates a new expression version restriction.
        Parameters:
        expr - the version restriction expression
        versionVariable - the variable representing the actual version of the project to be imported
        compoundVersionVariable - the version variable in terms of the (legacy) compound version
        Throws:
        net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException - in case of type compliance problems
    • Method Detail

      • createRestrictionVars

        public static DecisionVariableDeclaration[] createRestrictionVars​(java.lang.String modelName)
        Creates the restriction variables for IVML models.
        Parameters:
        modelName - the name of the model
        Returns:
        the restriction variables (1: the pseudo-compound variable, 0: the plain variable)
      • emit

        public void emit​(java.lang.Object context)
        Specified by:
        emit in interface net.ssehub.easy.basics.modelManagement.IVersionRestriction
      • toSpecification

        public java.lang.String toSpecification()
        Specified by:
        toSpecification in interface net.ssehub.easy.basics.modelManagement.IVersionRestriction
      • evaluate

        public boolean evaluate​(net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext context,
                                net.ssehub.easy.basics.modelManagement.Version version)
                         throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
        Specified by:
        evaluate in interface net.ssehub.easy.basics.modelManagement.IVersionRestriction
        Throws:
        net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      • copy

        public net.ssehub.easy.basics.modelManagement.IVersionRestriction copy​(net.ssehub.easy.basics.modelManagement.IModel model)
                                                                        throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
        Specified by:
        copy in interface net.ssehub.easy.basics.modelManagement.IVersionRestriction
        Throws:
        net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      • copy

        public net.ssehub.easy.basics.modelManagement.IVersionRestriction copy​(net.ssehub.easy.basics.modelManagement.IVersionRestriction.IVariableMapper mapper)
                                                                        throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
        Specified by:
        copy in interface net.ssehub.easy.basics.modelManagement.IVersionRestriction
        Throws:
        net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      • map

        private DecisionVariableDeclaration map​(net.ssehub.easy.basics.modelManagement.IVersionRestriction.IVariableMapper mapper,
                                                DecisionVariableDeclaration var)
        Maps var via mapper.
        Parameters:
        mapper - the mapper
        var - the variable to be mapped
        Returns:
        the mapped variable, possibly var