Class Unifier
java.lang.Object
ca.mcscert.jpipe.operators.Unifier
Phase 4 post-processor for composition operators.
After CompositionOperator.apply(String, List, Map) returns its command list, this class
inspects the element-creation commands, groups equivalent ones according to a
named EquivalenceRelation looked up in a
UnificationEquivalenceRegistry, and rewrites the command list so that
each equivalence class is represented by a single synthesized element whose
id is "unified_N" (N = 0-based counter per merged group). All
original member ids are aliased to the new id via RegisterAlias
commands, and AddSupport commands referencing removed ids are
rewritten accordingly.
Controlled by two optional config parameters:
unifyBy— name of the equivalence relation to use (default:"sameLabel")unifyExclude— comma-separated list of result-model element ids that must NOT participate in unification (default: empty)
If no merged groups are found the original command list is returned unchanged.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Unifier
-
-
Method Details
-
unify
Applies Phase 4 unification tocommands.- Parameters:
resultName- the name of the result model (used inRegisterAliascommands)commands- the command list produced by Phases 1–3 ofCompositionOperator.apply(String, List, Map)args- the operator config map;unifyByandunifyExcludeare consumed here- Returns:
- a new, unmodifiable command list with merged elements and
rewritten edges, or
commandsitself if nothing was merged - Throws:
InvalidOperatorCallException- ifunifyBynames an unknown equivalence relation
-