Package ghidra.util.datastruct
Class AbstractWeakValueMap<K,V>
- java.lang.Object
-
- ghidra.util.datastruct.AbstractWeakValueMap<K,V>
-
- Type Parameters:
K
- the type of keysV
- the type of values
- All Implemented Interfaces:
java.util.Map<K,V>
- Direct Known Subclasses:
AbstractWeakValueNavigableMap
,WeakValueHashMap
public abstract class AbstractWeakValueMap<K,V> extends java.lang.Object implements java.util.Map<K,V>
Class to provide a map with weak values, backed by a given map
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractWeakValueMap.GeneratedEntry
An entry for the "entrySet" method, since internally, entries are of weak-referenced values.protected static class
AbstractWeakValueMap.WeakValueRef<K,V>
A weak value ref that also knows its key in the map.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWeakValueMap()
Constructs a new weak map
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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)
protected abstract java.util.Map<K,AbstractWeakValueMap.WeakValueRef<K,V>>
getRefMap()
Returns the backing mapboolean
isEmpty()
java.util.Set<K>
keySet()
protected void
processQueue()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> map)
V
remove(java.lang.Object key)
int
size()
java.util.Collection<V>
values()
-
-
-
Field Detail
-
refQueue
protected java.lang.ref.ReferenceQueue<V> refQueue
-
-
Method Detail
-
getRefMap
protected abstract java.util.Map<K,AbstractWeakValueMap.WeakValueRef<K,V>> getRefMap()
Returns the backing map- Returns:
- the map
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
values
public java.util.Collection<V> values()
-
processQueue
protected void processQueue()
-
-