Class PurgeOnWriteSoftValueHashMap<K,V>

Type Parameters:
K - The type of key.
V - The type of value.
All Implemented Interfaces:
Map<K,V>

public class PurgeOnWriteSoftValueHashMap<K,V> extends AbstractPurgeOnWriteReferenceValueMap<K,V,PurgeOnWriteSoftValueHashMap.SoftValueReference<K,V>>
A map that uses soft references to store map values. Values are only purged when map write operations occur. null values are not supported.
Author:
Garret Wilson
  • Constructor Details

    • PurgeOnWriteSoftValueHashMap

      public PurgeOnWriteSoftValueHashMap(int initialCapacity, float loadFactor)
      Empty map constructor with the specified initial capacity and load factor.
      Parameters:
      initialCapacity - The initial capacity.
      loadFactor - The load factor.
      Throws:
      IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive.
    • PurgeOnWriteSoftValueHashMap

      public PurgeOnWriteSoftValueHashMap(int initialCapacity)
      Empty map constructor with the specified initial capacity and a default load factor.
      Parameters:
      initialCapacity - The initial capacity.
      Throws:
      IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive.
    • PurgeOnWriteSoftValueHashMap

      public PurgeOnWriteSoftValueHashMap()
      Default constructor with a default initial capacity and load factor.
    • PurgeOnWriteSoftValueHashMap

      protected PurgeOnWriteSoftValueHashMap(Map<K,PurgeOnWriteSoftValueHashMap.SoftValueReference<K,V>> map)
      Decorated map constructor.
      Parameters:
      map - The map to decorate.
      Throws:
      NullPointerException - If the map is null.
  • Method Details