weak library

Support weak referenced collection classes - WeakHashMap, WeakHashSet, WeakList and WeakReferenceQueue. Elements in such collections are weakly referenced and can be removed from the collection whenever the element is no longer referenced by other variables and garbage collected.

Classes

WeakHashMap<K extends Object, V>
An unordered hash-table based Map implementation with weak referenced keys. An entry in this weak hash map will be automatically removed when its key is garbage collected. That is, when there is no other way for the program to access the weak referenced key, its associated entry in this WeakHashMap is likely removed anytime.
WeakHashSet<E extends Object>
An unordered hash-table based Set implementation with weak referenced elements. An element in this weak hash set will be automatically removed when it is garbage collected. That is, when there is no other way for the program to access the weak referenced element, it is likely removed from this WeakHashSet anytime.
WeakList<E extends Object>
An ordered List implementation with weak referenced elements. An element in this weak list will be automatically nullified when it is garbage collected. That is, when there is no other way for the program to access the weak referenced element, it is likely nullified from this WeakList anytime. That is, the (List.[]) operator may return null if the element at the specified index is garbage collected.
WeakReferenceQueue<E extends Object, T extends Object>
A queue that maintains the payload of its associated weak referenced target.