Decorates another Bag to synchronize its behaviour
for a multi-threaded environment.
Methods are synchronized, then forwarded to the decorated bag.
Iterators must be separately synchronized around the loop.
This class is Serializable from Commons Collections 3.1.
since: Commons Collections 3.0 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: Stephen Colebourne
Inner Class :class SynchronizedBagSet extends SynchronizedSet
Constructor that wraps (not copies).
Parameters: bag - the bag to decorate, must not be null Parameters: lock - the lock to use, must not be null throws: IllegalArgumentException - if bag is null
Method Detail
add
public boolean add(Object object, int count)(Code)
Factory method to create a synchronized bag.
Parameters: bag - the bag to decorate, must not be null a new synchronized Bag throws: IllegalArgumentException - if bag is null