Class SchemaTraceabilityMap
java.lang.Object
edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.SchemaTraceabilityMap
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 Summary
ModifierConstructorDescriptionprotected
Construct a new SchemaTraceabilityMap copying the given map into a new map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConstraintIDOrigin
(ConstraintID constraintID, ConstraintID originalID) Adds the mapping between the constraintID and the originalIDprotected static SchemaTraceabilityMap
Method to collapse a list of maps into a unique one by means of joining them.getOriginalConstraintID
(ConstraintID constraintID) boolean
isEmpty()
joinMap
(SchemaTraceabilityMap current) This method builds a new SchemaTraceabilityMap containing the constraints of the current map pointing to the original constraintIDs of this mapint
size()
-
Constructor Details
-
SchemaTraceabilityMap
public SchemaTraceabilityMap() -
SchemaTraceabilityMap
Construct a new SchemaTraceabilityMap copying the given map into a new map.- Parameters:
toCopy
- not null
-
-
Method Details
-
collapseMaps
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
This method builds a new SchemaTraceabilityMap containing the constraints of the current map pointing to the original constraintIDs of this mapIn 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
Adds the mapping between the constraintID and the originalID- Parameters:
constraintID
- not nulloriginalID
- not null
-
getOriginalConstraintID
- 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.
-