Class NamedMap<K,​V>

  • Type Parameters:
    K -
    V -
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<K,​V>

    public final class NamedMap<K,​V>
    extends java.util.HashMap<K,​V>
    Extension to HashMap to give the map an event type name. This class is not serializable.
    Since:
    10.1
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • 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 
      Constructor Description
      NamedMap()
      Construct an empty Map with a null name.
      NamedMap​(int initialCapacity)
      Construct a map with the supplied initial capacity and null name.
      NamedMap​(int initialCapacity, float loadFactor)
      Construct a map with the supplied initial capacity and load factor and null name.
      NamedMap​(java.lang.String name)
      Construct an empty Map with the supplied event type name.
      NamedMap​(java.lang.String name, int initialCapacity)
      Construct a map with the supplied name and initial capacity.
      NamedMap​(java.lang.String name, int initialCapacity, float loadFactor)
      Construct a map with the supplied name, initial capacity and load factor.
      NamedMap​(java.lang.String name, java.util.Map<? extends K,​? extends V> map)
      Construct a map from the supplied name and underlying Map.
      NamedMap​(java.util.Map<? extends K,​? extends V> map)
      Construct a map from the supplied name and null name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear the map and name.
      java.lang.Object clone()  
      boolean equals​(java.lang.Object o)  
      java.lang.String getName()
      Get the event type name of the map.
      int hashCode()  
      void setName​(java.lang.String name)
      Set the event type name of the Map.
      java.lang.String toString()  
      • Methods inherited from class java.util.HashMap

        compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NamedMap

        public NamedMap​(java.lang.String name)
        Construct an empty Map with the supplied event type name.
        Parameters:
        name - the event type name associated with this map.
      • NamedMap

        public NamedMap​(java.lang.String name,
                        int initialCapacity)
        Construct a map with the supplied name and initial capacity.
        Parameters:
        name - the event type name associated with this map.
        initialCapacity - the initial capacity.
      • NamedMap

        public NamedMap​(java.lang.String name,
                        int initialCapacity,
                        float loadFactor)
        Construct a map with the supplied name, initial capacity and load factor.
        Parameters:
        name - the event type name associated with this map.
        initialCapacity - the initial capacity.
        loadFactor - the load factor
      • NamedMap

        public NamedMap​(java.lang.String name,
                        java.util.Map<? extends K,​? extends V> map)
        Construct a map from the supplied name and underlying Map.
        Parameters:
        name - the event type name associated with this map.
        map - the map whose mappings are to be placed in this map
      • NamedMap

        public NamedMap()
        Construct an empty Map with a null name.
      • NamedMap

        public NamedMap​(int initialCapacity)
        Construct a map with the supplied initial capacity and null name.
        Parameters:
        initialCapacity - the initial capacity.
      • NamedMap

        public NamedMap​(int initialCapacity,
                        float loadFactor)
        Construct a map with the supplied initial capacity and load factor and null name.
        Parameters:
        initialCapacity - the initial capacity.
        loadFactor - the load factor
      • NamedMap

        public NamedMap​(java.util.Map<? extends K,​? extends V> map)
        Construct a map from the supplied name and null name.
        Parameters:
        map - the map whose mappings are to be placed in this map
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
        Set the event type name of the Map.
        Parameters:
        name -
      • getName

        public java.lang.String getName()
        Get the event type name of the map. Can return null.
        Returns:
        event type name of the map
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<K,​V>
        Overrides:
        hashCode in class java.util.AbstractMap<K,​V>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.AbstractMap<K,​V>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map<K,​V>
        Overrides:
        equals in class java.util.AbstractMap<K,​V>
      • clear

        public void clear()
        Clear the map and name.
        Specified by:
        clear in interface java.util.Map<K,​V>
        Overrides:
        clear in class java.util.HashMap<K,​V>
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.util.HashMap<K,​V>