Class MildValues<K,V>

java.lang.Object
org.eclipse.sisu.inject.MildValues<K,V>
All Implemented Interfaces:
Map<K,V>
Direct Known Subclasses:
MildConcurrentValues

class MildValues<K,V> extends Object implements Map<K,V>
NON-thread-safe Map whose values are kept alive by soft/weak References.
  • Field Details

  • Constructor Details

  • Method Details

    • containsKey

      public final boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<K,V>
    • containsValue

      public final boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<K,V>
    • get

      public final V get(Object key)
      Specified by:
      get in interface Map<K,V>
    • put

      public final V put(K key, V value)
      Specified by:
      put in interface Map<K,V>
    • putAll

      public final void putAll(Map<? extends K,? extends V> m)
      Specified by:
      putAll in interface Map<K,V>
    • remove

      public final V remove(Object key)
      Specified by:
      remove in interface Map<K,V>
    • clear

      public final void clear()
      Specified by:
      clear in interface Map<K,V>
    • isEmpty

      public final boolean isEmpty()
      Specified by:
      isEmpty in interface Map<K,V>
    • size

      public final int size()
      Specified by:
      size in interface Map<K,V>
    • keySet

      public final Set<K> keySet()
      Specified by:
      keySet in interface Map<K,V>
    • values

      public final Collection<V> values()
      Specified by:
      values in interface Map<K,V>
    • entrySet

      public final Set<Map.Entry<K,V>> entrySet()
      Specified by:
      entrySet in interface Map<K,V>
    • mildValue

      final Reference<V> mildValue(K key, V value)
      Returns:
      Soft or weak Reference for the given key-value mapping.
    • tempValue

      static final <V> Reference<V> tempValue(V value)
      Returns:
      Temporary Reference for the given value; used in queries.
    • compact

      void compact()
      Compacts the map by removing cleared values.