Class AllocationImpl

All Implemented Interfaces:
de.uka.ipd.sdq.identifier.Identifier, org.eclipse.emf.cdo.CDOObject, org.eclipse.emf.cdo.common.id.CDOWithID, org.eclipse.emf.cdo.common.model.CDOPackageTypeRegistry.CDOObjectMarker, Notifier, EObject, EStructuralFeature.Internal.DynamicValueHolder, InternalEObject, org.eclipse.emf.spi.cdo.InternalCDOLoadable, org.eclipse.emf.spi.cdo.InternalCDOObject, Allocation, Entity, NamedElement, PCMBaseClass, PCMClass

public class AllocationImpl extends AllocationImplGen
  • Constructor Details

    • AllocationImpl

      public AllocationImpl()
  • Method Details

    • validateEachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce

      public boolean validateEachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce(DiagnosticChain diagnostics, Map<Object,Object> context)
      Specified by:
      validateEachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce in interface Allocation
      Overrides:
      validateEachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce in class AllocationImplGen
    • validateEachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce

      protected AllocationImpl.ValidationResult validateEachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce()
      Tests if each assembly context within the referenced system has been allocated correctly.
      Returns:
      Test result.
    • testAtMostOneAllocationForAssemblyContextExists

      protected AllocationImpl.ValidationResult testAtMostOneAllocationForAssemblyContextExists()
      Tests if each assembly context is allocated at most once.
      Returns:
      Test result.
    • getAllocatedAssemblyContexts

      protected Set<AssemblyContext> getAllocatedAssemblyContexts()
      Determines all assembly contexts that are part of the current allocation (this).
      Returns:
      A set of assembly contexts.
    • findUnallocatedAssemblyContexts

      protected Set<AssemblyContext> findUnallocatedAssemblyContexts(Set<AssemblyContext> allocatedAssemblyContexts)
      Determines assembly contexts of the system that are not part of a given set of assembly contexts. The given set represents assembly contexts that have already been allocated.
      Parameters:
      allocatedAssemblyContexts - A set of assembly contexts that shall not be part of the result set.
      Returns:
      A set of unallocated system assembly contexts.
    • extractAllSubsystems

      protected static Set<SubSystem> extractAllSubsystems(Set<AssemblyContext> assemblyContexts)
      Determines all SubSystem elements that are encapsulated by the given assembly contexts. This method ignores all other types of encapsulated components.
      Parameters:
      assemblyContexts -
      Returns:
      The set of encapsulated SubSystem elements.
    • testCorrectAllocationOfSubsystems

      protected static AllocationImpl.ValidationResult testCorrectAllocationOfSubsystems(Set<SubSystem> subsystems, Set<AssemblyContext> allocatedAssemblyContexts)
      Tests if all given SubSystem elements are allocated correctly by the given set of allocated AssemblyContext elements. A SubSystem is allocated correctly if it either is allocated directly or if all of its encapsulated components are allocated correctly.
      Parameters:
      subsystems - The set of subsystems to test.
      allocatedAssemblyContexts - The set of allocated assembly contexts.
      Returns:
      Test result.
    • getEntityLabel

      protected static String getEntityLabel(Entity entity)
      Generates a label for an Entity to be used in validation messages.
      Parameters:
      entity - The entity.
      Returns:
      The label.