public class SynchronizedSortedSet<E> extends SynchronizedCollection<E> implements SortedSet<E>
SortedSet to synchronize its behaviour
for a multi-threaded environment.
Methods are synchronized, then forwarded to the decorated set.
This class is Serializable from Commons Collections 3.1.
collection, lock| Modifier | Constructor and Description |
|---|---|
protected |
SynchronizedSortedSet(SortedSet<E> set)
Constructor that wraps (not copies).
|
protected |
SynchronizedSortedSet(SortedSet<E> set,
Object lock)
Constructor that wraps (not copies).
|
| Modifier and Type | Method and Description |
|---|---|
Comparator<? super E> |
comparator() |
E |
first() |
protected SortedSet<E> |
getSortedSet()
Gets the decorated set.
|
SortedSet<E> |
headSet(E toElement) |
E |
last() |
SortedSet<E> |
subSet(E fromElement,
E toElement) |
static <E> SynchronizedSortedSet<E> |
synchronizedSortedSet(SortedSet<E> set)
Factory method to create a synchronized set.
|
SortedSet<E> |
tailSet(E fromElement) |
add, addAll, clear, contains, containsAll, decorated, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, synchronizedCollection, toArray, toArray, toStringprotected SynchronizedSortedSet(SortedSet<E> set)
set - the set to decorate, must not be nullIllegalArgumentException - if set is nullprotected SynchronizedSortedSet(SortedSet<E> set, Object lock)
set - the set to decorate, must not be nulllock - the lock object to use, must not be nullIllegalArgumentException - if set is nullpublic static <E> SynchronizedSortedSet<E> synchronizedSortedSet(SortedSet<E> set)
E - the element typeset - the set to decorate, must not be nullIllegalArgumentException - if set is nullprotected SortedSet<E> getSortedSet()
public Comparator<? super E> comparator()
comparator in interface SortedSet<E>Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.