| java.lang.Object java.util.AbstractMap javassist.scopedpool.SoftValueHashMap
SoftValueHashMap | public class SoftValueHashMap extends AbstractMap implements Map(Code) | | This Map will remove entries when the value in the map has been cleaned from
garbage collection
version: $Revision: 1.3 $ author: Bill Burke |
Constructor Summary | |
public | SoftValueHashMap(int initialCapacity, float loadFactor) Constructs a new, empty WeakHashMap with the given initial
capacity and the given load factor. | public | SoftValueHashMap(int initialCapacity) Constructs a new, empty WeakHashMap with the given initial
capacity and the default load factor, which is 0.75 . | public | SoftValueHashMap() Constructs a new, empty WeakHashMap with the default
initial capacity and the default load factor, which is 0.75 . | public | SoftValueHashMap(Map t) Constructs a new WeakHashMap with the same mappings as the
specified Map. |
Method Summary | |
public void | clear() Removes all mappings from this map. | public boolean | containsKey(Object key) Returns true if this map contains a mapping for the
specified key. | public Set | entrySet() Returns a set of the mappings contained in this hash table. | public Object | get(Object key) Returns the value to which this map maps the specified key . | public boolean | isEmpty() Returns true if this map contains no key-value mappings. | public Object | put(Object key, Object value) Updates this map so that the given key maps to the given
value . | public Object | remove(Object key) Removes the mapping for the given key from this map, if
present.
Parameters: key - The key whose mapping is to be removed. | public int | size() Returns the number of key-value mappings in this map. |
SoftValueHashMap | public SoftValueHashMap(int initialCapacity, float loadFactor)(Code) | | Constructs a new, empty WeakHashMap with the given initial
capacity and the given load factor.
Parameters: initialCapacity - The initial capacity of the WeakHashMap Parameters: loadFactor - The load factor of the WeakHashMap throws: IllegalArgumentException - If the initial capacity is less than zero, or if the loadfactor is nonpositive |
SoftValueHashMap | public SoftValueHashMap(int initialCapacity)(Code) | | Constructs a new, empty WeakHashMap with the given initial
capacity and the default load factor, which is 0.75 .
Parameters: initialCapacity - The initial capacity of the WeakHashMap throws: IllegalArgumentException - If the initial capacity is less than zero |
SoftValueHashMap | public SoftValueHashMap()(Code) | | Constructs a new, empty WeakHashMap with the default
initial capacity and the default load factor, which is 0.75 .
|
SoftValueHashMap | public SoftValueHashMap(Map t)(Code) | | Constructs a new WeakHashMap with the same mappings as the
specified Map. The WeakHashMap is created with
an initial capacity of twice the number of mappings in the specified map
or 11 (whichever is greater), and a default load factor, which is
0.75.
Parameters: t - the map whose mappings are to be placed in this map. |
clear | public void clear()(Code) | | Removes all mappings from this map.
|
containsKey | public boolean containsKey(Object key)(Code) | | Returns true if this map contains a mapping for the
specified key.
Parameters: key - The key whose presence in this map is to be tested. |
entrySet | public Set entrySet()(Code) | | Returns a set of the mappings contained in this hash table.
|
get | public Object get(Object key)(Code) | | Returns the value to which this map maps the specified key .
If this map does not contain a value for this key, then return
null .
Parameters: key - The key whose associated value, if any, is to be returned. |
isEmpty | public boolean isEmpty()(Code) | | Returns true if this map contains no key-value mappings.
|
put | public Object put(Object key, Object value)(Code) | | Updates this map so that the given key maps to the given
value . If the map previously contained a mapping for
key then that mapping is replaced and the previous value
is returned.
Parameters: key - The key that is to be mapped to the given value Parameters: value - The value to which the given key is to bemapped The previous value to which this key was mapped, ornull if if there was no mapping for the key |
remove | public Object remove(Object key)(Code) | | Removes the mapping for the given key from this map, if
present.
Parameters: key - The key whose mapping is to be removed. The value to which this key was mapped, or null ifthere was no mapping for the key. |
size | public int size()(Code) | | Returns the number of key-value mappings in this map. Note:
In contrast with most implementations of the
Map interface, the time required by this operation is
linear in the size of the map.
|
|
|