K
- the type of keys maintained by this mapV
- the type of mapped valuespublic class WeakValueHashMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
HashMap
,
WeakReference
Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_CAPACITY
Default initial map capacity.
|
Constructor and Description |
---|
WeakValueHashMap()
Constructs an empty map with the default initial capacity (16) and the default load
factor (0.75).
|
WeakValueHashMap(int initialCapacity)
Constructs an empty map with the specified initial capacity and the default load factor (0.75).
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key) |
int |
size() |
java.util.Collection<V> |
values() |
public static final int INITIAL_CAPACITY
public WeakValueHashMap()
public WeakValueHashMap(int initialCapacity)
initialCapacity
- the initial capacity.java.lang.IllegalArgumentException
- if the initial capacity is negative.