Class MultiReaderFastList<T>

All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, MutableCollection<T>, InternalIterable<T>, ListIterable<T>, MultiReaderList<T>, MutableList<T>, OrderedIterable<T>, ReversibleIterable<T>, RichIterable<T>

public final class MultiReaderFastList<T> extends AbstractMultiReaderMutableCollection<T> implements RandomAccess, Externalizable, MultiReaderList<T>
MultiReadFastList provides a thread-safe wrapper around a FastList, using a ReentrantReadWriteLock. In order to provide true thread-safety, MultiReaderFastList does not implement iterator(), listIterator(), listIterator(int), or get(int), as all these methods require an external lock to be taken to provide thread-safe iteration. All of these methods are available however, if you use the withReadLockAndDelegate() or withWriteLockAndDelegate() methods. Both of these methods take a parameter of type Procedure<MutableList>, and a wrapped version of the underlying FastList is returned. This wrapper guarantees that no external pointer can ever reference the underlying FastList outside 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: