public class WeakValueMap<K,V> extends AbstractMap<K,V> implements Serializable
WeakReference
SoftValueMap
,
Serialized FormAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected Set<Map.Entry<K,V>> |
entrySet
This is a lazily created set of entries that is essentially a view to actual data
|
protected HashMap<K,R> |
map
This is a main data storage used for most operations
|
protected ReferenceQueue<V> |
referenceQueue |
Constructor and Description |
---|
WeakValueMap() |
WeakValueMap(int initialCapacity) |
WeakValueMap(Map<? extends K,? extends V> m) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkReferenceQueue()
Cleanup all references collected by GC so far
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected transient HashMap<K,R extends Reference<V>> map
protected transient ReferenceQueue<V> referenceQueue
public WeakValueMap()
public WeakValueMap(int initialCapacity)
public int size()
size
in interface Map<K,V>
size
in class AbstractMap<K,V>
public boolean isEmpty()
isEmpty
in interface Map<K,V>
isEmpty
in class AbstractMap<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public V get(Object key)
get
in interface Map<K,V>
get
in class AbstractMap<K,V>
public V put(K key, V value)
put
in interface Map<K,V>
put
in class AbstractMap<K,V>
public V remove(Object key)
remove
in interface Map<K,V>
remove
in class AbstractMap<K,V>
public void putAll(Map<? extends K,? extends V> m)
putAll
in interface Map<K,V>
putAll
in class AbstractMap<K,V>
public void clear()
clear
in interface Map<K,V>
clear
in class AbstractMap<K,V>
public Set<K> keySet()
keySet
in interface Map<K,V>
keySet
in class AbstractMap<K,V>
public Collection<V> values()
values
in interface Map<K,V>
values
in class AbstractMap<K,V>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K,V>
entrySet
in class AbstractMap<K,V>
protected void checkReferenceQueue()
Copyright © 2001–2019 Apache Cayenne. All rights reserved.