Class MultiReaderUnifiedSet<T>

All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Iterable<T>, Collection<T>, RandomAccess, Set<T>, MutableCollection<T>, InternalIterable<T>, RichIterable<T>, MultiReaderSet<T>, MutableSet<T>, MutableSetIterable<T>, SetIterable<T>, UnsortedSetIterable<T>

public final class MultiReaderUnifiedSet<T>
extends AbstractMultiReaderMutableCollection<T>
implements RandomAccess, Externalizable, MultiReaderSet<T>
MultiReadUnifiedSet provides a thread-safe wrapper around a UnifiedSet, using a ReentrantReadWriteLock. In order to provide true thread-safety, MultiReaderUnifiedSet does not implement iterator() as this method requires an external lock to be taken to provide thread-safe iteration. You can use an iterator() if you use the withReadLockAndDelegate() or withWriteLockAndDelegate() methods. Both of these methods take a parameter of type Procedure<MutableSet>, and a wrapped version of the underlying Unified is returned. This wrapper guarantees that no external pointer can ever reference the underlying UnifiedSet outside of a locked procedure. In the case of the read lock method, an Unmodifiable version of the collection is offered, which will throw UnsupportedOperationExceptions on any write methods like add or remove.
See Also:
Serialized Form