Class GenericStateHandler
- java.lang.Object
-
- UncertaintyVariationModel.statehandler.GenericStateHandler
-
- All Implemented Interfaces:
StateHandler
- Direct Known Subclasses:
AllocationStateHandler
,AssemblyStateHandler
,BranchStateHandler
,CharacteristicsStateHandler
public abstract class GenericStateHandler extends Object implements StateHandler
GenericStateHandler realizes the abstract base class for StateHandler.
-
-
Constructor Summary
Constructors Constructor Description GenericStateHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T extends EObject>
Optional<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.abstract int
getSizeOfDimension(VariationPoint variationPoint)
computes and return the size of a VariationPoints variation space.abstract void
patchModelWith(Map<String,List<EObject>> models, VariationPoint variationPoint, int variationIdx)
patches the models with a VariationPoint's variationIdx variation.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.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.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.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface UncertaintyVariationModel.statehandler.StateHandler
getModelTypes, getValue
-
-
-
-
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 interfaceStateHandler
- 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 interfaceStateHandler
- Parameters:
models
- the models which are uses by one of the StateHandlersvariationPoint
- the current VariationPointvariationIdx
- 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 inelement
- 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 inelements
- 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 inelement
- 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 inelements
- 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 EObject> Optional<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 intypeFilter
- predicate to filter elements in the container with a type expressionvalueFilter
- 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
-
-