Class AliasRegistry

java.lang.Object
ca.mcscert.jpipe.operators.AliasRegistry

public final class AliasRegistry extends Object
Mutable registry that maps original element ids to the merged id chosen during Phase 1 of CompositionOperator.apply(String, List, Map).

Merge functions populate this registry by calling register(String, List) or register(String, String). CompositionOperator then uses it in Phase 2 to translate original edge endpoints to their merged counterparts, and emits one RegisterAlias command per entry so the mapping survives in the compiled Unit.

  • Constructor Details

    • AliasRegistry

      public AliasRegistry()
  • Method Details

    • register

      public void register(String newId, List<String> oldIds)
      Records that newId is the merged identity of all oldIds. Typically called by a merge function once it has chosen the new element id.
    • register

      public void register(String newId, String oldId)
      Convenience single-id overload.
    • resolve

      public String resolve(String oldId)
      Returns the new id that oldId was merged into, or oldId itself if no alias was registered (element was kept as-is).
    • aliases

      public Map<String,String> aliases()
      Read-only view of all registered aliases.