Class WeakObjectRegistry<K,E extends K>

All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public class WeakObjectRegistry<K,E extends K> extends AbstractSet<E>
An object registry that uses weak references to keep track of the stored objects. The registry can be used to retrieve stored objects using another, equivalent object. As such, it can be used to prevent the use of duplicates in another data structure, reducing memory usage. The objects that are being stored should properly implement the Object.equals(java.lang.Object) and Object.hashCode() methods.