public class SynchronizedSet extends SynchronizedCollection implements Set
Set
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 |
SynchronizedSet(Set set)
Constructor that wraps (not copies).
|
protected |
SynchronizedSet(Set set,
Object lock)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
static Set |
decorate(Set set)
Factory method to create a synchronized set.
|
protected Set |
getSet()
Gets the decorated set.
|
add, addAll, clear, contains, containsAll, decorate, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected SynchronizedSet(Set set)
set
- the set to decorate, must not be nullIllegalArgumentException
- if set is nullprotected SynchronizedSet(Set 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 Set decorate(Set set)
set
- the set to decorate, must not be nullIllegalArgumentException
- if set is nullprotected Set getSet()
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.