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
ConstructorsConstructorDescriptionSoftCacheMap(int cacheSize) Constructs a new SoftCacheMap that has at most cacheSize entries. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()voidintsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
containsKeyin interfaceMap<K,V> - See Also:
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V> - See Also:
-
values
-
putAll
-
entrySet
-
keySet
-
remove
-