org.apache.commons.collections.bag
Class SynchronizedSortedBag
- Bag, Collection, Bag, Serializable, SortedBag
public class SynchronizedSortedBag
Decorates another
SortedBag 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.
$Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
add, addAll, clear, contains, containsAll, decorate, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
SynchronizedSortedBag
protected SynchronizedSortedBag(Bag bag,
Object lock) Constructor that wraps (not copies).
bag - the bag to decorate, must not be nulllock - the lock to use, must not be null
SynchronizedSortedBag
protected SynchronizedSortedBag(SortedBag bag)
Constructor that wraps (not copies).
bag - the bag to decorate, must not be null
decorate
public static SortedBag decorate(SortedBag bag)
Factory method to create a synchronized sorted bag.
bag - the bag to decorate, must not be null
- a new synchronized SortedBag
getSortedBag
protected SortedBag getSortedBag()
Gets the bag being decorated.
Copyright © 2001-2015 Apache Software Foundation. All Rights Reserved.