Class EMFHelper

java.lang.Object
de.uka.ipd.sdq.dsexplore.helper.EMFHelper

public class EMFHelper extends Object
Also see EcoreUtil for more helper functions like EcoreUtil.equals(EObject, EObject) to test for equality.
  • Constructor Details

    • EMFHelper

      public EMFHelper()
  • Method Details

    • checkIdentity

      public static boolean checkIdentity(EObject i1, EObject i2)
      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 Identifier
      i2 - Another Identifier
      Returns:
      true if i1.getId().equals(i2.getId()), false otherwise
    • contains

      public static boolean contains(Collection<? extends EObject> coll, EObject i)
      Implements an identifier-based contains. Calls checkIdentity(Identifier, Identifier) to compare the Identifier 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

      public static void saveToXMIFile(EObject modelToSave, URI fileName)
      Save the given EObject to the file given by filename.
      Parameters:
      modelToSave - The EObject to save
      fileName - The filename where to save.
    • loadFromXMIFile

      public static EObject loadFromXMIFile(URI fileName, EPackage ePackage)
      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

      public static EObject loadFromXMIFile(URI uri, ResourceSet resourceSet, EPackage ePackage)
    • retrieveEntityByID

      public static org.palladiosimulator.pcm.core.entity.Entity retrieveEntityByID(List<? extends EObject> entities, EObject object)
    • retrieveEntityByID

      public static org.palladiosimulator.pcm.core.entity.Entity retrieveEntityByID(List<? extends org.palladiosimulator.pcm.core.entity.Entity> entities, String id)
    • indexOfByID

      public static int indexOfByID(List<? extends org.palladiosimulator.pcm.core.entity.Entity> entities, String id)
    • createEMFCandidates

      public static Candidates createEMFCandidates(Collection<DSEIndividual> individuals)
    • getPassiveResources

      public static List<org.palladiosimulator.pcm.repository.PassiveResource> getPassiveResources(List<org.palladiosimulator.pcm.repository.Repository> repositoryList)
    • 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

      public static EObject loadFromXMIFile(String fileName, EPackage ePackage)
      Deprecated.