Class SynchronizedCollection<E>

java.lang.Object
org.apache.commons.collections4.collection.SynchronizedCollection<E>
Type Parameters:
E - the type of the elements in the collection
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>
Direct Known Subclasses:
SynchronizedBag, SynchronizedMultiSet, SynchronizedQueue

public class SynchronizedCollection<E> extends Object implements Collection<E>, Serializable
Decorates another Collection to synchronize its behavior for a multithreaded environment.

Iterators must be manually synchronized:

 synchronized (coll) {
   Iterator it = coll.iterator();
   // do stuff with iterator
 }
 

This class is Serializable from Commons Collections 3.1.

Since:
3.0
See Also: