org.eclipse.incquery.patternlanguage.emf.specification.builder

## Class NameToSpecificationMap

- java.lang.Object
- - org.eclipse.incquery.patternlanguage.emf.specification.builder.NameToSpecificationMap

- All Implemented Interfaces:
    java.util.Map<java.lang.String,IQuerySpecification<?>>

      public class NameToSpecificationMap
      extends java.lang.Object
      implements java.util.Map<java.lang.String,IQuerySpecification<?>>

  A helper class for storing a mapping between a set of fully qualified names and `IQuerySpecification` instances. The IncQuery builder maintains one of them during building, while for the generic API the user might want to manage it.
  Author:
    Zoltan Ujhelyi

- - ### Nested Class Summary

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NameToSpecificationMap()`
    `NameToSpecificationMap(java.util.Collection<? extends IQuerySpecification<?>> specifications)`
    `NameToSpecificationMap(IncQueryEngine engine)` Initializes a pattern-specification mapping with the contents of an existing `IncQueryEngine`.
    `NameToSpecificationMap(IQuerySpecification<?>... specifications)`
    `NameToSpecificationMap(java.util.Map<java.lang.String,IQuerySpecification<?>> source)`

  - ### 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<java.lang.String,IQuerySpecification<?>>>` | `entrySet()`
    `IQuerySpecification<?>` | `get(java.lang.Object key)`
    `java.util.Collection<IQuerySpecification<?>>` | `getSpecificationsWithStatus(PQuery.PQueryStatus status)` Returns a collection of specifications with the selected status
    `IQuerySpecification<?>` | `getSpecificationWithStatus(PQuery.PQueryStatus status)` Returns a specification with the selected status
    `boolean` | `isEmpty()`
    `java.util.Set<java.lang.String>` | `keySet()`
    `IQuerySpecification<?>` | `put(java.lang.String key, IQuerySpecification<?> value)`
    `void` | `putAll(java.util.Map<? extends java.lang.String,? extends IQuerySpecification<?>> values)`
    `IQuerySpecification<?>` | `remove(java.lang.Object key)`
    `int` | `size()`
    `java.util.Collection<IQuerySpecification<?>>` | `values()`

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

      `equals, 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

    - #### NameToSpecificationMap

          public NameToSpecificationMap()

    - #### NameToSpecificationMap

          public NameToSpecificationMap(IQuerySpecification<?>... specifications)

    - #### NameToSpecificationMap

          public NameToSpecificationMap(java.util.Collection<? extends IQuerySpecification<?>> specifications)

    - #### NameToSpecificationMap

          public NameToSpecificationMap(java.util.Map<java.lang.String,IQuerySpecification<?>> source)

    - #### NameToSpecificationMap

          public NameToSpecificationMap(IncQueryEngine engine)

      Initializes a pattern-specification mapping with the contents of an existing `IncQueryEngine`.

      Warning It is assumed that each query specification in the engine has a unique fqn - if the assumption fails, the resulting map is unspecified.

      Parameters:
        `engine` -

  - ### Method Detail

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### containsKey

          public boolean containsKey(java.lang.Object key)

      Specified by:
        `containsKey` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### containsValue

          public boolean containsValue(java.lang.Object value)

      Specified by:
        `containsValue` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### entrySet

          public java.util.Set<java.util.Map.Entry<java.lang.String,IQuerySpecification<?>>> entrySet()

      Specified by:
        `entrySet` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### get

          public IQuerySpecification<?> get(java.lang.Object key)

      Specified by:
        `get` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### keySet

          public java.util.Set<java.lang.String> keySet()

      Specified by:
        `keySet` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### put

          public IQuerySpecification<?> put(java.lang.String key,
                                            IQuerySpecification<?> value)

      Specified by:
        `put` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### putAll

          public void putAll(java.util.Map<? extends java.lang.String,? extends IQuerySpecification<?>> values)

      Specified by:
        `putAll` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### remove

          public IQuerySpecification<?> remove(java.lang.Object key)

      Specified by:
        `remove` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### values

          public java.util.Collection<IQuerySpecification<?>> values()

      Specified by:
        `values` in interface `java.util.Map<java.lang.String,IQuerySpecification<?>>`

    - #### getSpecificationWithStatus

          public IQuerySpecification<?> getSpecificationWithStatus(PQuery.PQueryStatus status)

      Returns a specification with the selected status
      Parameters:
        `status` -
      Returns:
        a specification with the selected status, or null if no such specification is available

    - #### getSpecificationsWithStatus

          public java.util.Collection<IQuerySpecification<?>> getSpecificationsWithStatus(PQuery.PQueryStatus status)

      Returns a collection of specifications with the selected status
      Parameters:
        `status` -
      Returns:
        a non-null (but possibly empty) specification list