Package com.globalmentor.collections
Class SynchronizedSetDecorator<E>
java.lang.Object
com.globalmentor.collections.SynchronizedCollectionDecorator<E>
com.globalmentor.collections.SynchronizedSetDecorator<E>
- Type Parameters:
E
- The type of element contained in the set.
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
public class SynchronizedSetDecorator<E>
extends SynchronizedCollectionDecorator<E>
implements Set<E>
A set that wraps an existing set, providing access through the
Set
interface. All collection access is synchronized on the provided synchronization
object.- Author:
- Garret Wilson
-
Field Summary
Fields inherited from class com.globalmentor.collections.SynchronizedCollectionDecorator
collection, mutex
-
Constructor Summary
ConstructorDescriptionSynchronizedSetDecorator
(Set<E> set) Set constructor.SynchronizedSetDecorator
(Set<E> set, Object mutex) Set and mutex constructor. -
Method Summary
Methods inherited from class com.globalmentor.collections.SynchronizedCollectionDecorator
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Field Details
-
set
The set this class decorates.
-
-
Constructor Details
-
SynchronizedSetDecorator
Set constructor. The new instance of this class is used as a mutex.- Parameters:
set
- The set this set should decorate.- Throws:
NullPointerException
- if the provided set isnull
.
-
SynchronizedSetDecorator
Set and mutex constructor.- Parameters:
set
- The set this set should decorate.mutex
- The mutual exclusion synchronization object.- Throws:
NullPointerException
- if the provided set and/or mutex isnull
.
-