E - the type of the elements of this set.@Mutable @GenerateBuilder @GenerateSubclass public abstract class ConcurrentHashSet<E> extends AbstractSet<E> implements ConcurrentSet<E>
ConcurrentHashMap.| Modifier | Constructor and Description |
|---|---|
protected |
ConcurrentHashSet(@NonNegative int initialCapacity,
@Positive float loadFactor,
@Positive int concurrencyLevel) |
protected |
ConcurrentHashSet(@Nonnull Set<? extends E> set) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
boolean |
addAll(@Nonnull Collection<? extends E> collection) |
void |
clear() |
boolean |
contains(@Nonnull Object object) |
boolean |
containsAll(@Nonnull Collection<?> collection) |
boolean |
isEmpty() |
@Nonnull Iterator<E> |
iterator() |
boolean |
remove(@Nullable Object object) |
boolean |
retainAll(@Nonnull Collection<?> collection) |
@NonNegative int |
size() |
@Nonnull Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
@Nonnull String |
toString() |
static <E> ConcurrentHashSet<E> |
withElementsOf(Set<? extends E> set)
Returns a new concurrent hash set with the elements of the given set or null if the given set is null.
|
equals, hashCode, removeAllclone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, hashCode, removeAll, spliteratorparallelStream, removeIf, stream@Recover
protected ConcurrentHashSet(@NonNegative @Default(value="16")
@NonNegative int initialCapacity,
@Positive @Default(value="0.75f")
@Positive float loadFactor,
@Positive @Default(value="1")
@Positive int concurrencyLevel)
@Pure @Capturable public static <E> ConcurrentHashSet<E> withElementsOf(@NonCaptured @Unmodified Set<? extends E> set)
@Pure @NonNegative public @NonNegative int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>@Pure public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>@Pure public boolean contains(@NonCaptured @Unmodified @Nonnull @Nonnull Object object)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>@Pure @Capturable @Nonnull public @Nonnull Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>@Pure @Capturable @Nonnull public <T> T[] toArray(@NonCaptured @Modified @Nonnull T[] array)
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>@Impure
public boolean add(@Captured
E element)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>@Impure public boolean remove(@NonCaptured @Unmodified @Nullable @Nullable Object object)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>@Pure public boolean containsAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> collection)
containsAll in interface Collection<E>containsAll in interface Set<E>containsAll in class AbstractCollection<E>@Impure public boolean addAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<? extends E> collection)
addAll in interface Collection<E>addAll in interface Set<E>addAll in class AbstractCollection<E>@Impure public boolean retainAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> collection)
retainAll in interface Collection<E>retainAll in interface Set<E>retainAll in class AbstractCollection<E>@Impure public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>Copyright © 2017. All rights reserved.