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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkIdentity
(EObject i1, EObject i2) Checks for two PCM model elements whether they are the same, i.e.static boolean
contains
(Collection<? extends EObject> coll, EObject i) Implements an identifier-based contains.static Candidates
createEMFCandidates
(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 int
indexOfByID
(List<? extends org.palladiosimulator.pcm.core.entity.Entity> entities, String id) static EObject
loadFromXMIFile
(String fileName, EPackage ePackage) Deprecated.static EObject
loadFromXMIFile
(URI fileName, EPackage ePackage) Copied From de.uka.ipd.sdq.pcmsolver.models.PCMInstance.static EObject
loadFromXMIFile
(URI uri, ResourceSet resourceSet, EPackage ePackage) static boolean
retainAll
(Collection<? extends de.uka.ipd.sdq.identifier.Identifier> collection, Collection<? extends EObject> itemsToRetain) static org.palladiosimulator.pcm.core.entity.Entity
retrieveEntityByID
(List<? extends EObject> entities, EObject object) static org.palladiosimulator.pcm.core.entity.Entity
retrieveEntityByID
(List<? extends org.palladiosimulator.pcm.core.entity.Entity> entities, String id) static void
saveToXMIFile
(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 theIdentifier
i with the contents of the collection.- Parameters:
coll
-i
-- Returns:
- true if there is an
Identifier
in 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