public class StrategyUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
areTheAlgorithmFamilyAndContextsPartOfAVariability(AlgorithmFamily algorithmFamily,
java.util.List<Element> contexts)
Are the algorithm family and contexts part of A variability.
|
static Interface |
createStrategyInterfaceForAlgorithmFamily(AlgorithmFamily algorithmFamily)
Creates the strategy interface for algorithm family.
|
protected static java.util.List<Interface> |
getAllStrategyInterfacesFromSetOfElements(java.util.List<Element> elements)
Gets the all strategy interfaces from set of elements.
|
static Interface |
getStrategyInterfaceFromAlgorithmFamily(AlgorithmFamily algorithmFamily)
Gets the Strategy interface from the algorithm family, if there is one.
|
static void |
moveContextsRelationshipWithSameTypeAndName(java.util.List<Element> contexts,
java.util.List<Element> participants,
Element target)
Move contexts relationship with same type and name.
|
static void |
moveVariabilitiesFromContextsToTarget(java.util.List<Element> contexts,
java.util.List<Element> participants,
Element target)
Move variabilities from contexts to target.
|
public static Interface getStrategyInterfaceFromAlgorithmFamily(AlgorithmFamily algorithmFamily)
A Strategy interface is an interface implemented by all elements from an algorithm family and with all the methods from these elements (methods are equal if their names and return types are equal).
algorithmFamily
- The algorithm family you want to get the Strategy interface from.protected static java.util.List<Interface> getAllStrategyInterfacesFromSetOfElements(java.util.List<Element> elements)
elements
- the elementspublic static Interface createStrategyInterfaceForAlgorithmFamily(AlgorithmFamily algorithmFamily)
algorithmFamily
- the algorithm familypublic static boolean areTheAlgorithmFamilyAndContextsPartOfAVariability(AlgorithmFamily algorithmFamily, java.util.List<Element> contexts)
algorithmFamily
- the algorithm familycontexts
- the contextspublic static void moveContextsRelationshipWithSameTypeAndName(java.util.List<Element> contexts, java.util.List<Element> participants, Element target)
contexts
- the contextsparticipants
- the participantstarget
- the targetpublic static void moveVariabilitiesFromContextsToTarget(java.util.List<Element> contexts, java.util.List<Element> participants, Element target)
contexts
- the contextsparticipants
- the participantstarget
- the target