Class AbstractConcurrentSet<T>
java.lang.Object
net.engio.mbassy.common.AbstractConcurrentSet<T>
- All Implemented Interfaces:
Iterable<T>, Collection<T>, Set<T>
- Direct Known Subclasses:
StrongConcurrentSet, WeakConcurrentSet
This data structure is optimized for non-blocking reads even when write operations occur.
Running read iterators will not be affected by add operations since writes always insert at the head of the
structure. Remove operations can affect any running iterator such that a removed element that has not yet
been reached by the iterator will not appear in that iterator anymore.
- Author:
- bennidi Date: 2/12/12, dorkbox Date: 22/2/15
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractConcurrentSet.Entry<T> protected final ReentrantReadWriteLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> elements) voidclear()booleanbooleancontainsAll(Collection<?> c) protected abstract AbstractConcurrentSet.Entry<T> createEntry(T value, AbstractConcurrentSet.Entry<T> next) booleaninthashCode()booleanisEmpty()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
iterator, spliterator
-
Field Details
-
lock
-
head
-
-
Constructor Details
-
AbstractConcurrentSet
-
-
Method Details
-
createEntry
protected abstract AbstractConcurrentSet.Entry<T> createEntry(T value, AbstractConcurrentSet.Entry<T> next) -
add
-
contains
-
size
-
isEmpty
-
addAll
-
remove
-
toArray
-
toArray
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>
-
removeAll
-
retainAll
-
clear
-
hashCode
-
equals
-