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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(@NotNull Collection<? extends E> c) void
clear()
boolean
boolean
containsAll
(@NotNull Collection<?> c) boolean
isEmpty()
iterator()
The returned iterator does not support removal.boolean
boolean
removeAll
(@NotNull Collection<?> c) boolean
retainAll
(@NotNull Collection<?> c) int
size()
@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, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods 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:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
add
-
remove
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear()
-