Package org.eclipse.viatra.query.runtime.matchers.util

## Class MemoryViewBackedMapView<T>

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.util.MemoryViewBackedMapView<T>

- All Implemented Interfaces:
    `java.util.Map<T,​java.lang.Integer>`

      public class MemoryViewBackedMapView<T>
      extends java.lang.Object
      implements java.util.Map<T,​java.lang.Integer>

  A partial and read-only Map implementation, mapping elements to multiplicities backed by an `IMemoryView`.

  Not implemented: write methods.

  Inefficiently implemented: `containsValue(Object)`, `values()`, `entrySet()`.

  Since:
    2.0

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

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `MemoryViewBackedMapView​(IMemoryView<T> wrapped)` |

  - ### 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<T,​java.lang.Integer>>` | `entrySet()` |
    `java.lang.Integer` | `get​(java.lang.Object key)` |
    `boolean` | `isEmpty()` |
    `java.util.Set<T>` | `keySet()` |
    `java.lang.Integer` | `put​(T key, java.lang.Integer value)` |
    `void` | `putAll​(java.util.Map<? extends T,​? extends java.lang.Integer> m)` |
    `java.lang.Integer` | `remove​(java.lang.Object key)` |
    `int` | `size()` |
    `java.lang.String` | `toString()` |
    `java.util.Collection<java.lang.Integer>` | `values()` |

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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

    - #### MemoryViewBackedMapView

          protected MemoryViewBackedMapView​(IMemoryView<T> wrapped)

      Parameters:
        `wrapped` - a memory view whose contents are to be exposed as an element-to-integer map.

  - ### Method Detail

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### containsKey

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

      Specified by:
        `containsKey` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### containsValue

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

      Specified by:
        `containsValue` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### put

          public java.lang.Integer put​(T key,
                                       java.lang.Integer value)

      Specified by:
        `put` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### get

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

      Specified by:
        `get` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### remove

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

      Specified by:
        `remove` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### putAll

          public void putAll​(java.util.Map<? extends T,​? extends java.lang.Integer> m)

      Specified by:
        `putAll` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### keySet

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

      Specified by:
        `keySet` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### values

          public java.util.Collection<java.lang.Integer> values()

      Specified by:
        `values` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### entrySet

          public java.util.Set<java.util.Map.Entry<T,​java.lang.Integer>> entrySet()

      Specified by:
        `entrySet` in interface `java.util.Map<T,​java.lang.Integer>`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`