org.eclipse.viatra.transformation.evm.qrm

## Class EVMBasedQueryResultMultimap<Match extends IPatternMatch,KeyType,ValueType>

- java.lang.Object
- - org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore<KeyType,ValueType>
  - - org.eclipse.viatra.query.runtime.base.api.QueryResultMultimap<KeyType,ValueType>
    - - org.eclipse.viatra.transformation.evm.qrm.EVMBasedQueryResultMultimap<Match,KeyType,ValueType>

- All Implemented Interfaces:
    com.google.common.collect.Multimap<KeyType,ValueType>

      public abstract class EVMBasedQueryResultMultimap<Match extends IPatternMatch,KeyType,ValueType>
      extends QueryResultMultimap<KeyType,ValueType>

  This `QueryResultMultimap` implementation uses the EVM to provide a query-based multimap. The contents of the multimap will be updated when the activations are fired in the EVM.

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore

      `NOT_ALLOW_MODIFICATIONS`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `EVMBasedQueryResultMultimap(ExecutionSchema schema)` Creates a multimap on top of the given execution schema.
    `protected` | `EVMBasedQueryResultMultimap(ViatraQueryEngine engine)` Creates a new multimap on the given engine.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<Matcher extends ViatraQueryMatcher<Match>> void` | `addMatcherToMultimapResults(IQuerySpecification<Matcher> querySpecification)` Adds the given query into the results of the multimap.
    `protected abstract KeyType` | `getKeyFromMatch(Match match)` Processes the given match and returns the key to be used in the multimap.
    `protected abstract ValueType` | `getValueFromMatch(Match match)` Processes the given match and returns the value to be used in the mulitmap.

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.base.api.QueryResultMultimap

      `asMap, clear, containsEntry, containsKey, containsValue, entries, get, getCache, getCacheEntries, internalCacheContainsEntry, internalCachePut, internalCacheRemove, internalCacheSize, isEmpty, keys, keySet, put, putAll, putAll, remove, removeAll, replaceValues, setCache, size, values`

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore

      `addCallbackOnQueryResultUpdate, checkModificationThroughQueryResultSetter, getListeners, getLogger, getSetter, internalClear, internalPut, internalRemove, modifyThroughQueryResultSetter, notifyListeners, removeCallbackOnQueryResultUpdate, setListeners, setLogger, setQueryResultSetter, setSetter`

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

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

    - ### Methods inherited from interface com.google.common.collect.Multimap

      `equals, hashCode`

- - ### Constructor Detail

    - #### EVMBasedQueryResultMultimap

          protected EVMBasedQueryResultMultimap(ExecutionSchema schema)

      Creates a multimap on top of the given execution schema.
      Parameters:
        `schema` -

    - #### EVMBasedQueryResultMultimap

          protected EVMBasedQueryResultMultimap(ViatraQueryEngine engine)

      Creates a new multimap on the given engine. It will use an execution schema that is scheduled with IQBase update callbacks.

  - ### Method Detail

    - #### addMatcherToMultimapResults

          public <Matcher extends ViatraQueryMatcher<Match>> void addMatcherToMultimapResults(IQuerySpecification<Matcher> querySpecification)

      Adds the given query into the results of the multimap.
      Parameters:
        `querySpecification` -

    - #### getKeyFromMatch

          protected abstract KeyType getKeyFromMatch(Match match)

      Processes the given match and returns the key to be used in the multimap.
      Parameters:
        `match` -
      Returns:
        the computed key

    - #### getValueFromMatch

          protected abstract ValueType getValueFromMatch(Match match)

      Processes the given match and returns the value to be used in the mulitmap.
      Parameters:
        `match` -
      Returns:
        the computed value