java.lang.Object
edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.SchemaTraceabilityMap

public class SchemaTraceabilityMap extends Object
This class is responsible to recall which constraintsID (from one schema) comes from what constraintID (from an original schema) when applying a logic process
  • Constructor Details

    • SchemaTraceabilityMap

      public SchemaTraceabilityMap()
    • SchemaTraceabilityMap

      protected SchemaTraceabilityMap(SchemaTraceabilityMap toCopy)
      Construct a new SchemaTraceabilityMap copying the given map into a new map.
      Parameters:
      toCopy - not null
  • Method Details

    • collapseMaps

      protected static SchemaTraceabilityMap collapseMaps(List<SchemaTraceabilityMap> maps)
      Method to collapse a list of maps into a unique one by means of joining them.

      In particular, the new map will contain the finalConstraintIDs of the first map given pointing to the originalConstraintIDs of the last map given.

      E.g.: first map might be {A2 -> A1}, whereas the second might be {A1 -> A0} so that the final result will be {A2 -> A0}.

      Parameters:
      maps - not-null
      Returns:
      a new SchemaTraceabilityMap
    • joinMap

      public SchemaTraceabilityMap joinMap(SchemaTraceabilityMap current)
      This method builds a new SchemaTraceabilityMap containing the constraints of the current map pointing to the original constraintIDs of this map

      In particular, the method joins the original constraintID of the current map, with the final constraintID of this map.

      E.g.: if the current SchemaTraceabilityMap contains the mapping F1 -> O1 and this SchemaTraceabilityMap contains the mapping O1 -> OO1 the resulting map will contain F1 -> OO1

      Parameters:
      current - not null
      Returns:
      a new SchemaTraceabilityMap changing the original constraintId of the current map, for the original constraintId, as defined by previous, of the original constraintId.
      Throws:
      MapsDoNotJoin - if the current map has some constraintID whose original constraintID did not join any original constraintID from this map
    • isEmpty

      public boolean isEmpty()
      Returns:
      whether the current traceability does not map any constraint to any original constraint id.
    • addConstraintIDOrigin

      public void addConstraintIDOrigin(ConstraintID constraintID, ConstraintID originalID)
      Adds the mapping between the constraintID and the originalID
      Parameters:
      constraintID - not null
      originalID - not null
    • getOriginalConstraintID

      public ConstraintID getOriginalConstraintID(ConstraintID constraintID)
      Parameters:
      constraintID - not null
      Returns:
      the original constraintID of the given constraintID, might be null if not found
    • size

      public int size()
      Returns:
      the number of mapped constraint IDs to original constraint IDs.