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.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| protected | SynchronizedSortedBag(final SortedBag<E>
the bag to decorate, must not be null bag)Constructor that wraps (not copies). |
| protected | SynchronizedSortedBag(final Bag<E>
the bag to decorate, must not be null bag, final Object the lock to use, must not be null lock)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Comparator | comparator()
Implements org. |
| public synchronized E | first()
Implements org. |
| protected SortedBag | |
| public synchronized E | |
| public static < the type of the elements in the bag E> SynchronizedSortedBag | Returns: a new synchronized SortedBagthe bag to decorate, must not be null bag)Factory method to create a synchronized sorted bag. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| SynchronizedSortedBag | back to summary |
|---|---|
| protected SynchronizedSortedBag(final SortedBag<E> bag) Constructor that wraps (not copies).
| |
| SynchronizedSortedBag | back to summary |
|---|---|
| protected SynchronizedSortedBag(final Bag<E> bag, final Object lock) Constructor that wraps (not copies).
| |
| comparator | back to summary |
|---|---|
| public synchronized Comparator Implements org. Doc from org. Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
| |
| first | back to summary |
|---|---|
| public synchronized E first() Implements org. Doc from org. Returns the first (lowest) member.
| |
| getSortedBag | back to summary |
|---|---|
| protected SortedBag Gets the bag being decorated.
| |
| last | back to summary |
|---|---|
| public synchronized E last() Implements org. Doc from org. Returns the last (highest) member.
| |
| synchronizedSortedBag | back to summary |
|---|---|
| public static <E> SynchronizedSortedBag Factory method to create a synchronized sorted bag.
| |