Package com.atlassian.bamboo.concurrent
Class BlockingSet<E>
java.lang.Object
com.atlassian.bamboo.concurrent.BlockingSet<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>
It fulfills the general Set contract, with one important difference:
if an equal element already exists, insertion of an element is blocked until it can be inserted.
The implementation is HashSet backed and thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(@NotNull Collection<? extends E> c) voidclear()booleanbooleancontainsAll(@NotNull Collection<?> c) booleanisEmpty()iterator()The returned iterator does not support removal.booleanbooleanremoveAll(@NotNull Collection<?> c) booleanretainAll(@NotNull Collection<?> c) intsize()@NotNull Object[]toArray()<T> @NotNull T[]toArray(@NotNull T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
BlockingSet
public BlockingSet()
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
The returned iterator does not support removal. -
toArray
-
toArray
@NotNull public <T> @NotNull T[] toArray(@NotNull @NotNull T[] a) -
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
add
-
remove
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear()
-