Class StringHashMap<V>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,​V>

    class StringHashMap<V>
    extends java.util.HashMap<java.lang.Object,​V>
    Converts keys to strings, mainly to normalize the difference between GString and String keys since a GString will not produce the same hashcode as its equivalent string. Basically, any given key will always be coerced to a String, and any retrieved key (either via HashMap.keySet() or HashMap.entrySet() will always be a String.
    • 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>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      StringHashMap()  
      StringHashMap​(java.util.Map<?,​? extends V> contents)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.Object key)  
      V get​(java.lang.Object key)  
      V put​(java.lang.Object key, V value)  
      void putAll​(java.util.Map<?,​? extends V> m)  
      V remove​(java.lang.Object key)  
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Constructor Detail

      • StringHashMap

        public StringHashMap()
      • StringHashMap

        public StringHashMap​(java.util.Map<?,​? extends V> contents)
    • Method Detail

      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.Object,​V>
        Overrides:
        containsKey in class java.util.HashMap<java.lang.Object,​V>
      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.Object,​V>
        Overrides:
        get in class java.util.HashMap<java.lang.Object,​V>
      • put

        public V put​(java.lang.Object key,
                     V value)
        Specified by:
        put in interface java.util.Map<java.lang.Object,​V>
        Overrides:
        put in class java.util.HashMap<java.lang.Object,​V>
      • putAll

        public void putAll​(java.util.Map<?,​? extends V> m)
        Specified by:
        putAll in interface java.util.Map<java.lang.Object,​V>
        Overrides:
        putAll in class java.util.HashMap<java.lang.Object,​V>
      • remove

        public V remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.Object,​V>
        Overrides:
        remove in class java.util.HashMap<java.lang.Object,​V>