Package org.eclipse.viatra.query.runtime.rete.aggregation

## Class GroupedMap<GroupedKeyType,​ValueType>

- java.lang.Object
- - org.eclipse.viatra.query.runtime.rete.aggregation.GroupedMap<GroupedKeyType,​ValueType>

- All Implemented Interfaces:
    `java.util.Map<Tuple,​ValueType>`

      public class GroupedMap<GroupedKeyType,​ValueType>
      extends java.lang.Object
      implements java.util.Map<Tuple,​ValueType>

  An optimized `Map` implementation where each key is produced by joining together a group tuple and some other object (via left inheritance). Only a select few `Map` operations are supported. This collection is unmodifiable. Operations on this map assume that client queries also obey the contract that keys are constructed from a group tuple and an additional object.
  Since:
    2.4

- - ### Nested Class Summary

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

      `java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Tuple` | `group` |
    `protected java.util.Map<GroupedKeyType,​ValueType>` | `mappings` |
    `protected IQueryRuntimeContext` | `runtimeContext` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GroupedMap​(Tuple group, java.util.Map<GroupedKeyType,​ValueType> mappings, IQueryRuntimeContext runtimeContext)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clear()` |
    `boolean` | `containsKey​(java.lang.Object key)` |
    `boolean` | `containsValue​(java.lang.Object value)` |
    `java.util.Set<java.util.Map.Entry<Tuple,​ValueType>>` | `entrySet()` |
    `ValueType` | `get​(java.lang.Object key)` |
    `boolean` | `isEmpty()` |
    `java.util.Set<Tuple>` | `keySet()` |
    `ValueType` | `put​(Tuple key, ValueType value)` |
    `void` | `putAll​(java.util.Map<? extends Tuple,​? extends ValueType> map)` |
    `ValueType` | `remove​(java.lang.Object key)` |
    `int` | `size()` |
    `java.util.Collection<ValueType>` | `values()` |

    - ### 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`

- - ### Field Detail

    - #### group

          protected final Tuple group

    - #### mappings

          protected final java.util.Map<GroupedKeyType,​ValueType> mappings

    - #### runtimeContext

          protected final IQueryRuntimeContext runtimeContext

  - ### Constructor Detail

    - #### GroupedMap

          public GroupedMap​(Tuple group,
                            java.util.Map<GroupedKeyType,​ValueType> mappings,
                            IQueryRuntimeContext runtimeContext)

  - ### Method Detail

    - #### size

          public int size()

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

    - #### isEmpty

          public boolean isEmpty()

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

    - #### containsKey

          public boolean containsKey​(java.lang.Object key)

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

    - #### containsValue

          public boolean containsValue​(java.lang.Object value)

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

    - #### get

          public ValueType get​(java.lang.Object key)

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

    - #### put

          public ValueType put​(Tuple key,
                               ValueType value)

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

    - #### remove

          public ValueType remove​(java.lang.Object key)

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

    - #### putAll

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

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

    - #### clear

          public void clear()

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

    - #### keySet

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

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

    - #### values

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

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

    - #### entrySet

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

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