public class SynchronizedSortedBag<E> extends SynchronizedBag<E> implements SortedBag<E>
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 | Method and Description |
---|---|
java.util.Comparator<? super E> |
comparator()
Returns the comparator associated with this sorted set, or null
if it uses its elements' natural ordering.
|
E |
first()
Returns the first (lowest) member.
|
E |
last()
Returns the last (highest) member.
|
static <E> SynchronizedSortedBag<E> |
synchronizedSortedBag(SortedBag<E> bag)
Factory method to create a synchronized sorted bag.
|
add, equals, getCount, hashCode, remove, synchronizedBag, uniqueSet
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, synchronizedCollection, toArray, toArray, toString
add, add, containsAll, getCount, iterator, remove, remove, removeAll, retainAll, size, uniqueSet
public static <E> SynchronizedSortedBag<E> synchronizedSortedBag(SortedBag<E> bag)
E
- the type of the elements in the bagbag
- the bag to decorate, must not be nulljava.lang.NullPointerException
- if bag is nullpublic E first()
SortedBag
public E last()
SortedBag
public java.util.Comparator<? super E> comparator()
SortedBag
comparator
in interface SortedBag<E>
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"