Package org.eclipse.viatra.transformation.evm.api.adapter

## Class AdaptableRuleBase

- java.lang.Object
- - org.eclipse.viatra.transformation.evm.api.RuleBase
  - - org.eclipse.viatra.transformation.evm.api.adapter.AdaptableRuleBase

-     public class AdaptableRuleBase
      extends RuleBase

  A `RuleBase` that allows `IEVMListener`s to listen to the creation and removal of EVM `RuleSpecification`s

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected AdaptableEVM` | `vm` |

    - ### Fields inherited from class org.eclipse.viatra.transformation.evm.api.RuleBase

      `agenda, eventRealm, logger, ruleInstanceTable`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AdaptableRuleBase​(EventRealm eventRealm, Agenda agenda, AdaptableEVM adapterContainer)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `dispose()` | Disposes of each rule instance managed by the agenda.
    `protected <EventAtom> RuleInstance<EventAtom>` | `instantiateRule​(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter)` | Instantiates the given specification over the EventRealm of the RuleBase.
    `protected <EventAtom> boolean` | `removeRule​(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter)` | Removes and disposes of a rule instance with the given specification.

    - ### Methods inherited from class org.eclipse.viatra.transformation.evm.api.RuleBase

      `createScopedConflictSet, findInstance, getAgenda, getEventRealm, getInstance, getLogger, getRuleInstances, getRuleSpecificationMultimap, removeRule`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### vm

          protected final AdaptableEVM vm

  - ### Constructor Detail

    - #### AdaptableRuleBase

          public AdaptableRuleBase​(EventRealm eventRealm,
                                   Agenda agenda,
                                   AdaptableEVM adapterContainer)

  - ### Method Detail

    - #### instantiateRule

          protected <EventAtom> RuleInstance<EventAtom> instantiateRule​(RuleSpecification<EventAtom> specification,
                                                                        EventFilter<? super EventAtom> filter)

      Description copied from class: `RuleBase`
      Instantiates the given specification over the EventRealm of the RuleBase. If the specification was already instantiated, the existing instance is returned.
      Overrides:
        `instantiateRule` in class `RuleBase`
      Parameters:
        `specification` - the rule to be instantiated
      Returns:
        the created or existing rule instance

    - #### removeRule

          protected <EventAtom> boolean removeRule​(RuleSpecification<EventAtom> specification,
                                                   EventFilter<? super EventAtom> filter)

      Description copied from class: `RuleBase`
      Removes and disposes of a rule instance with the given specification.
      Overrides:
        `removeRule` in class `RuleBase`
        `filter` - the partial match used as filter
      Returns:
        true, if the specification had an instance in the RuleBase

    - #### dispose

          protected void dispose()

      Description copied from class: `RuleBase`
      Disposes of each rule instance managed by the agenda.
      Overrides:
        `dispose` in class `RuleBase`