Package ghidra.util.datastruct
Class WeakStore<T>
java.lang.Object
ghidra.util.datastruct.WeakStore<T>
- Type Parameters:
T
- The type of objects stored in this WeakStore
Class for storing a weak reference to object instances. Objects of type T can be placed in this
store and they will remain there until there are no references to that object. Note
that this is not a Set and you can have multiple instances that are "equal" in this store.The
main purpose of this store is to be able to get all objects in the store that are still
referenced. This is useful when you need to visit all in use items.
This class is thread safe.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
refQueue
-
-
Constructor Details
-
WeakStore
public WeakStore()
-
-
Method Details
-
size
public int size()Returns the number of objects of type T remaining in the store. Those that are remaining are either still referenced- Returns:
- the number of objects still in the store that haven't yet been garbage collected
-
getValues
returns a list of all the objects in this store- Returns:
- a list of all the objects in this store
-
add
Adds the given value to the store- Parameters:
value
- the instance being added to the store
-