Package ghidra.util.datastruct
Class SoftCacheMap<K,V>
java.lang.Object
ghidra.util.datastruct.SoftCacheMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
Class to manage a "soft" HaspMap that keeps its keys as soft references so
they can be reclaimed if needed. Useful for caching.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionSoftCacheMap
(int cacheSize) Constructs a new SoftCacheMap that has at most cacheSize entries. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
isEmpty()
keySet()
void
int
size()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SoftCacheMap
public SoftCacheMap(int cacheSize) Constructs a new SoftCacheMap that has at most cacheSize entries.- Parameters:
cacheSize
- the max number of entries to cache.
-
-
Method Details
-
put
-
get
-
size
public int size() -
clear
public void clear() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - See Also:
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V> - See Also:
-
values
-
putAll
-
entrySet
-
keySet
-
remove
-