org.eclipse.viatra.query.runtime.base.api

## Class QueryResultMap<KeyType,ValueType>

- java.lang.Object
- - org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore<KeyType,ValueType>
  - - org.eclipse.viatra.query.runtime.base.api.QueryResultMap<KeyType,ValueType>

- All Implemented Interfaces:
    java.util.Map<KeyType,ValueType>

      public abstract class QueryResultMap<KeyType,ValueType>
      extends QueryResultAssociativeStore<KeyType,ValueType>
      implements java.util.Map<KeyType,ValueType>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `java.util.Map.Entry<K,V>`

  - ### 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` | `QueryResultMap(org.apache.log4j.Logger logger)` Constructor only visible to subclasses.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `boolean` | `containsKey(java.lang.Object key)`
    `boolean` | `containsValue(java.lang.Object value)`
    `java.util.Set<java.util.Map.Entry<KeyType,ValueType>>` | `entrySet()`
    `ValueType` | `get(java.lang.Object key)`
    `protected java.util.Map<KeyType,ValueType>` | `getCache()`
    `protected java.util.Collection<java.util.Map.Entry<KeyType,ValueType>>` | `getCacheEntries()` Returns the entries in the cache as a collection.
    `protected boolean` | `internalCacheContainsEntry(KeyType key, ValueType value)`
    `protected boolean` | `internalCachePut(KeyType key, ValueType value)`
    `protected boolean` | `internalCacheRemove(KeyType key, ValueType value)`
    `protected int` | `internalCacheSize()`
    `boolean` | `isEmpty()`
    `java.util.Set<KeyType>` | `keySet()`
    `ValueType` | `put(KeyType key, ValueType value)`
    `void` | `putAll(java.util.Map<? extends KeyType,? extends ValueType> map)`
    `ValueType` | `remove(java.lang.Object key)`
    `protected void` | `setCache(java.util.Map<KeyType,ValueType> cache)`
    `int` | `size()`
    `java.util.Collection<ValueType>` | `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 java.util.Map

      `compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Constructor Detail

    - #### QueryResultMap

          protected QueryResultMap(org.apache.log4j.Logger logger)

      Constructor only visible to subclasses.
      Parameters:
        `logger` - a logger that can be used for error reporting

  - ### Method Detail

    - #### getCacheEntries

          protected java.util.Collection<java.util.Map.Entry<KeyType,ValueType>> getCacheEntries()

      Description copied from class: `QueryResultAssociativeStore`
      Returns the entries in the cache as a collection.
      Specified by:
        `getCacheEntries` in class `QueryResultAssociativeStore<KeyType,ValueType>`
      Returns:
        the entries

    - #### internalCachePut

          protected boolean internalCachePut(KeyType key,
                                             ValueType value)

      Specified by:
        `internalCachePut` in class `QueryResultAssociativeStore<KeyType,ValueType>`

    - #### internalCacheRemove

          protected boolean internalCacheRemove(KeyType key,
                                                ValueType value)

      Specified by:
        `internalCacheRemove` in class `QueryResultAssociativeStore<KeyType,ValueType>`

    - #### internalCacheSize

          protected int internalCacheSize()

      Specified by:
        `internalCacheSize` in class `QueryResultAssociativeStore<KeyType,ValueType>`

    - #### internalCacheContainsEntry

          protected boolean internalCacheContainsEntry(KeyType key,
                                                       ValueType value)

      Specified by:
        `internalCacheContainsEntry` in class `QueryResultAssociativeStore<KeyType,ValueType>`

    - #### getCache

          protected java.util.Map<KeyType,ValueType> getCache()

      Returns:
        the cache

    - #### setCache

          protected void setCache(java.util.Map<KeyType,ValueType> cache)

      Parameters:
        `cache` - the cache to set

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `java.util.Map<KeyType,ValueType>`

    - #### containsKey

          public boolean containsKey(java.lang.Object key)

      Specified by:
        `containsKey` in interface `java.util.Map<KeyType,ValueType>`

    - #### containsValue

          public boolean containsValue(java.lang.Object value)

      Specified by:
        `containsValue` in interface `java.util.Map<KeyType,ValueType>`

    - #### entrySet

          public java.util.Set<java.util.Map.Entry<KeyType,ValueType>> entrySet()

      The returned set is immutable.

      Specified by:
        `entrySet` in interface `java.util.Map<KeyType,ValueType>`

    - #### get

          public ValueType get(java.lang.Object key)

      Specified by:
        `get` in interface `java.util.Map<KeyType,ValueType>`

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `java.util.Map<KeyType,ValueType>`

    - #### keySet

          public java.util.Set<KeyType> keySet()

      The returned set is immutable.

      Specified by:
        `keySet` in interface `java.util.Map<KeyType,ValueType>`

    - #### put

          public ValueType put(KeyType key,
                               ValueType value)

      Throws `UnsupportedOperationException` if there is no `IQueryResultSetter`

      Specified by:
        `put` in interface `java.util.Map<KeyType,ValueType>`

    - #### putAll

          public void putAll(java.util.Map<? extends KeyType,? extends ValueType> map)

      Throws `UnsupportedOperationException` if there is no `IQueryResultSetter`

      Specified by:
        `putAll` in interface `java.util.Map<KeyType,ValueType>`

    - #### remove

          public ValueType remove(java.lang.Object key)

      Throws `UnsupportedOperationException` if there is no `IQueryResultSetter`

      Specified by:
        `remove` in interface `java.util.Map<KeyType,ValueType>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Map<KeyType,ValueType>`

    - #### values

          public java.util.Collection<ValueType> values()

      The returned collection is immutable.

      Specified by:
        `values` in interface `java.util.Map<KeyType,ValueType>`