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>
public class BlockingSet<E> extends Object implements 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 Constructor Description BlockingSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(@NotNull Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(@NotNull Collection<?> c)booleanisEmpty()@NotNull Iterator<E>iterator()The returned iterator does not support removal.booleanremove(Object o)booleanremoveAll(@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, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
iterator
@NotNull public @NotNull Iterator<E> iterator()
The returned iterator does not support removal.
-
toArray
@NotNull public @NotNull Object[] toArray()
-
toArray
@NotNull public <T> @NotNull T[] toArray(@NotNull @NotNull T[] a)
-
containsAll
public boolean containsAll(@NotNull @NotNull Collection<?> c)- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
add
public boolean add(E e)
-
remove
public boolean remove(Object o)
-
addAll
public boolean addAll(@NotNull @NotNull Collection<? extends E> c)
-
retainAll
public boolean retainAll(@NotNull @NotNull Collection<?> c)
-
removeAll
public boolean removeAll(@NotNull @NotNull Collection<?> c)
-
-