Class ReferenceValueHashMap<K,​V>

  • Type Parameters:
    K - the key type
    V - the value type
    All Implemented Interfaces:
    java.util.Map<K,​V>
    Direct Known Subclasses:
    SoftValueHashMap, WeakValueHashMap

    public abstract class ReferenceValueHashMap<K,​V>
    extends ReferenceValueMap<K,​V>
    This Map will remove entries when the value in the map has been cleaned from garbage collection
    • 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>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Map<K,​ValueRef<K,​V>> createMap()
      Create map.
      protected java.util.Map<K,​ValueRef<K,​V>> createMap​(int initialCapacity)
      Create map.
      protected java.util.Map<K,​ValueRef<K,​V>> createMap​(int initialCapacity, float loadFactor)
      Create map.
      protected java.util.Map<K,​ValueRef<K,​V>> createMap​(java.util.Comparator<K> kComparator)
      Create map.
      protected java.util.Map<K,​ValueRef<K,​V>> createMap​(java.util.SortedMap<K,​ValueRef<K,​V>> kValueRefSortedMap)
      Create map.
      • Methods inherited from class java.util.AbstractMap

        clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, values
      • Methods inherited from class java.lang.Object

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

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • ReferenceValueHashMap

        protected ReferenceValueHashMap()
      • ReferenceValueHashMap

        protected ReferenceValueHashMap​(int initialCapacity)
      • ReferenceValueHashMap

        protected ReferenceValueHashMap​(int initialCapacity,
                                        float loadFactor)
      • ReferenceValueHashMap

        protected ReferenceValueHashMap​(java.util.Map<K,​V> t)
    • Method Detail

      • createMap

        protected java.util.Map<K,​ValueRef<K,​V>> createMap​(int initialCapacity,
                                                                       float loadFactor)
        Description copied from class: ReferenceValueMap
        Create map.
        Specified by:
        createMap in class ReferenceValueMap<K,​V>
        Parameters:
        initialCapacity - the initial capacity
        loadFactor - the load factor
        Returns:
        new map instance
      • createMap

        protected java.util.Map<K,​ValueRef<K,​V>> createMap​(int initialCapacity)
        Description copied from class: ReferenceValueMap
        Create map.
        Specified by:
        createMap in class ReferenceValueMap<K,​V>
        Parameters:
        initialCapacity - the initial capacity
        Returns:
        new map instance
      • createMap

        protected java.util.Map<K,​ValueRef<K,​V>> createMap​(java.util.Comparator<K> kComparator)
        Description copied from class: ReferenceValueMap
        Create map.
        Specified by:
        createMap in class ReferenceValueMap<K,​V>
        Parameters:
        kComparator - the comparator
        Returns:
        new map instance