Class Pool<E>

All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, Set<E>, InterningSet<E>
Direct Known Subclasses:
SegmentSequence.SegmentSequencePool, SegmentSequence.StringArrayPool, URI.URIPool

public class Pool<E> extends WeakInterningHashSet<E>
A thread safe implementation of a weak interning hash set particularly well-suited for implementing a pool of instances. All access is thread safe, guarded with a shared read lock and an exclusive getWriteLock() lock to support multiple simultaneous readers while ensuring that writes are properly serial. The locks are held for the minimal period to allow maximal concurrency. Removals, i.e., remove, removeAll, clear, and retainAll, are not supported.
Since:
2.9
See Also: