| java.lang.Object java.util.AbstractMap org.cojen.util.SoftValuedHashMap
SoftValuedHashMap | public class SoftValuedHashMap extends AbstractMap implements Map,Cloneable(Code) | | A Map that softly references its values and can be used as a simple cache.
SoftValuedHashMap is not thread-safe and must be wrapped with
Collections.synchronizedMap to be made thread-safe.
Note: Softly referenced entries may be automatically removed during
either accessor or mutator operations, possibly causing a concurrent
modification to be detected. Therefore, even if multiple threads are only
accessing this map, be sure to synchronize this map first. Also, do not
rely on the value returned by size() when using an iterator from this map.
The iterators may return less entries than the amount reported by size().
author: Brian S O'Neill |
Constructor Summary | |
public | SoftValuedHashMap(int initialCapacity, float loadFactor) Constructs a new, empty map with the specified initial
capacity and the specified load factor. | public | SoftValuedHashMap(int initialCapacity) Constructs a new, empty map with the specified initial capacity
and default load factor, which is 0.75. | public | SoftValuedHashMap() Constructs a new, empty map with a default capacity and load
factor, which is 0.75. | public | SoftValuedHashMap(Map t) Constructs a new map with the same mappings as the given map. |
SoftValuedHashMap | public SoftValuedHashMap(int initialCapacity, float loadFactor)(Code) | | Constructs a new, empty map with the specified initial
capacity and the specified load factor.
Parameters: initialCapacity - the initial capacity of the HashMap. Parameters: loadFactor - the load factor of the HashMap throws: IllegalArgumentException - if the initial capacity is lessthan zero, or if the load factor is nonpositive. |
SoftValuedHashMap | public SoftValuedHashMap(int initialCapacity)(Code) | | Constructs a new, empty map with the specified initial capacity
and default load factor, which is 0.75.
Parameters: initialCapacity - the initial capacity of the HashMap. throws: IllegalArgumentException - if the initial capacity is lessthan zero. |
SoftValuedHashMap | public SoftValuedHashMap()(Code) | | Constructs a new, empty map with a default capacity and load
factor, which is 0.75.
|
SoftValuedHashMap | public SoftValuedHashMap(Map t)(Code) | | Constructs a new map with the same mappings as the given map. The
map is created with a capacity of twice the number of mappings in
the given map or 11 (whichever is greater), and a default load factor,
which is 0.75.
|
clear | public void clear()(Code) | | |
containsValue | public boolean containsValue(Object value)(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | |
|
|