Package de.uka.ipd.sdq.dsexplore.helper
Class EMFHelper
java.lang.Object
de.uka.ipd.sdq.dsexplore.helper.EMFHelper
Also see
EcoreUtil for more helper functions
like EcoreUtil.equals(EObject, EObject) to
test for equality.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckIdentity(EObject i1, EObject i2) Checks for two PCM model elements whether they are the same, i.e.static booleancontains(Collection<? extends EObject> coll, EObject i) Implements an identifier-based contains.static CandidatescreateEMFCandidates(Collection<DSEIndividual> individuals) static List<org.palladiosimulator.pcm.allocation.AllocationContext>getAllUsedAllocationContexts(org.palladiosimulator.pcm.allocation.Allocation allocation) static List<org.palladiosimulator.pcm.core.composition.AssemblyContext>getAllUsedAssemblyContexts(org.palladiosimulator.pcm.core.entity.ComposedProvidingRequiringEntity composite) Recursively get all contained AssemblyContexts in one flat list.static List<org.palladiosimulator.pcm.repository.PassiveResource>getPassiveResources(List<org.palladiosimulator.pcm.repository.Repository> repositoryList) static intindexOfByID(List<? extends org.palladiosimulator.pcm.core.entity.Entity> entities, String id) static EObjectloadFromXMIFile(String fileName, EPackage ePackage) Deprecated.static EObjectloadFromXMIFile(URI fileName, EPackage ePackage) Copied From de.uka.ipd.sdq.pcmsolver.models.PCMInstance.static EObjectloadFromXMIFile(URI uri, ResourceSet resourceSet, EPackage ePackage) static booleanretainAll(Collection<? extends de.uka.ipd.sdq.identifier.Identifier> collection, Collection<? extends EObject> itemsToRetain) static org.palladiosimulator.pcm.core.entity.EntityretrieveEntityByID(List<? extends EObject> entities, EObject object) static org.palladiosimulator.pcm.core.entity.EntityretrieveEntityByID(List<? extends org.palladiosimulator.pcm.core.entity.Entity> entities, String id) static voidsaveToXMIFile(EObject modelToSave, URI fileName) Save the given EObject to the file given by filename.
-
Constructor Details
-
EMFHelper
public EMFHelper()
-
-
Method Details
-
checkIdentity
Checks for two PCM model elements whether they are the same, i.e. whether they have the same ID. The model elements have to be derived from Identifier. Note that two systems might use the same assembly contexts and components, but still are two different systems. If one of the Identifiers in null, false is returned.- Parameters:
i1- One Identifieri2- Another Identifier- Returns:
- true if i1.getId().equals(i2.getId()), false otherwise
-
contains
Implements an identifier-based contains. CallscheckIdentity(Identifier, Identifier)to compare theIdentifieri with the contents of the collection.- Parameters:
coll-i-- Returns:
- true if there is an
Identifierin coll with an id equal to i.getID().
-
retainAll
public static boolean retainAll(Collection<? extends de.uka.ipd.sdq.identifier.Identifier> collection, Collection<? extends EObject> itemsToRetain) -
saveToXMIFile
Save the given EObject to the file given by filename.- Parameters:
modelToSave- The EObject to savefileName- The filename where to save.
-
loadFromXMIFile
Copied From de.uka.ipd.sdq.pcmsolver.models.PCMInstance.- Parameters:
fileName- the filename specifying the file to load from- Returns:
- The EObject loaded from the file
-
loadFromXMIFile
-
retrieveEntityByID
-
retrieveEntityByID
-
indexOfByID
-
createEMFCandidates
-
getPassiveResources
-
getAllUsedAssemblyContexts
public static List<org.palladiosimulator.pcm.core.composition.AssemblyContext> getAllUsedAssemblyContexts(org.palladiosimulator.pcm.core.entity.ComposedProvidingRequiringEntity composite) Recursively get all contained AssemblyContexts in one flat list. -
getAllUsedAllocationContexts
public static List<org.palladiosimulator.pcm.allocation.AllocationContext> getAllUsedAllocationContexts(org.palladiosimulator.pcm.allocation.Allocation allocation) -
loadFromXMIFile
Deprecated.useloadFromXMIFile(URI, EPackage)instead
-
loadFromXMIFile(URI, EPackage)instead