Class FastCopyHashMap<K,​V>

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

    public class FastCopyHashMap<K,​V>
    extends AbstractMap<K,​V>
    implements java.util.Map<K,​V>, java.lang.Cloneable,
    A HashMap that is optimized for fast shallow copies.

    Null keys are not supported.

    Jason T. Greene
    See Also:
    Serialized Form
    • Constructor Detail

      • FastCopyHashMap

        public FastCopyHashMap​(int initialCapacity,
                               float loadFactor)
      • FastCopyHashMap

        public FastCopyHashMap​(java.util.Map<? extends K,​? extends V> map)
      • FastCopyHashMap

        public FastCopyHashMap​(int initialCapacity)
      • FastCopyHashMap

        public FastCopyHashMap()
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Map<K,​V>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<K,​V>
      • get

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

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<K,​V>
      • toString

        public java.lang.String toString()
        Returns a string representation of this map. The string representation consists of a list of key-value mappings in the order returned by the map's entrySet view's iterator, enclosed in braces ("{}"). Adjacent mappings are separated by the characters ", " (comma and space). Each key-value mapping is rendered as the key followed by an equals sign ("=") followed by the associated value. Keys and values are converted to strings as by String.valueOf(Object).
        toString in class java.lang.Object
        a string representation of this map
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K,​V>
      • putAll

        public void putAll​(java.util.Map<? extends K,​? extends V> map)
        Specified by:
        putAll in interface java.util.Map<K,​V>
      • remove

        public V remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<K,​V>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<K,​V>
      • clone

        public FastCopyHashMap<K,​V> clone()
        clone in class java.lang.Object
      • printDebugStats

        public void printDebugStats()
      • values

        public java.util.Collection<V> values()
        Specified by:
        values in interface java.util.Map<K,​V>
      • keySet

        public java.util.Set<K> keySet()
        Specified by:
        keySet in interface java.util.Map<K,​V>
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​V>