Class GenericStateHandler

    • Constructor Detail

      • GenericStateHandler

        public GenericStateHandler()
    • Method Detail

      • getSizeOfDimension

        public abstract int getSizeOfDimension​(VariationPoint variationPoint)
        Description copied from interface: StateHandler
        computes and return the size of a VariationPoints variation space.
        Specified by:
        getSizeOfDimension in interface StateHandler
        Parameters:
        variationPoint - the current VariationPoint
        Returns:
        the computed size of the variation space
      • patchModelWith

        public abstract void patchModelWith​(Map<String,​List<EObject>> models,
                                            VariationPoint variationPoint,
                                            int variationIdx)
        Description copied from interface: StateHandler
        patches the models with a VariationPoint's variationIdx variation.
        Specified by:
        patchModelWith in interface StateHandler
        Parameters:
        models - the models which are uses by one of the StateHandlers
        variationPoint - the current VariationPoint
        variationIdx - the current position in the VariationPoints variation space
      • resolve

        protected Optional<EObject> resolve​(EObject container,
                                            de.uka.ipd.sdq.identifier.Identifier element)
        finds an optional model element in the container which corresponds to the element.
        Parameters:
        container - the container to search in
        element - the search specification
        Returns:
        the model element that corresponds the element otherwise empty
      • reslove

        protected List<Optional<EObject>> reslove​(EObject container,
                                                  List<de.uka.ipd.sdq.identifier.Identifier> elements)
        finds optional model elements in the container which corresponds to each given element in elements.
        Parameters:
        container - the container to search in
        elements - the search specifications
        Returns:
        list with model elements that corresponds to an element otherwise empty. The resulting list will have the same number of of elements as number of elements to be searched.
      • resolve

        protected Optional<EObject> resolve​(List<EObject> containers,
                                            de.uka.ipd.sdq.identifier.Identifier element)
        finds an optional model element in the first container that contains it which corresponds to the element.
        Parameters:
        containers - the containers to search in
        element - the search specification
        Returns:
        the model element that corresponds the element otherwise empty
      • resolve

        protected List<Optional<EObject>> resolve​(List<EObject> containers,
                                                  List<de.uka.ipd.sdq.identifier.Identifier> elements)
        finds optional model elements in the first container that contains it which corresponds to each given element in elements.
        Parameters:
        containers - the containers to search in
        elements - the search specifications
        Returns:
        list with model elements that corresponds to an element otherwise empty. The resulting list will have the same number of of elements as number of elements to be searched.
      • findInstance

        protected <T extends EObjectOptional<T> findInstance​(EObject container,
                                                               Predicate<EObject> typeFilter,
                                                               Predicate<T> valueFilter)
        finds an optional model element in the container that fulfills the type filter and the valueFilter.
        Type Parameters:
        T - the type of the model element
        Parameters:
        container - the container to search in
        typeFilter - predicate to filter elements in the container with a type expression
        valueFilter - predicate to filter elements in the container with attribute values. It is used after the typeFilter.
        Returns:
        the model element that fits the filter or empty