Interface ReferenceMap

  • All Superinterfaces:
    java.util.Map
    All Known Implementing Classes:
    ConcurrentReferenceHashMap, ReferenceHashMap

    public interface ReferenceMap
    extends java.util.Map
    A Map type that can hold its keys, values, or both with weak or soft references.
    Author:
    Abe White
    • Nested Class Summary

      • 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 Abstract Methods 
      Modifier and Type Method Description
      void keyExpired​(java.lang.Object value)
      Overridable callback for when a key reference expires.
      void removeExpired()
      Purge stale entries.
      void valueExpired​(java.lang.Object key)
      Overridable callback for when a value reference expires.
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Method Detail

      • removeExpired

        void removeExpired()
        Purge stale entries.
      • keyExpired

        void keyExpired​(java.lang.Object value)
        Overridable callback for when a key reference expires.
        Parameters:
        value - the value for the expired key
      • valueExpired

        void valueExpired​(java.lang.Object key)
        Overridable callback for when a value reference expires.
        Parameters:
        key - the key for the expired value