Class ConcurrentOpenHashSet<V>
- java.lang.Object
-
- org.apache.pulsar.common.util.collections.ConcurrentOpenHashSet<V>
-
- Type Parameters:
V-
public class ConcurrentOpenHashSet<V> extends java.lang.ObjectConcurrent hash set.Provides similar methods as a
ConcurrentMap<K,V>but since it's an open hash map with linear probing, no node allocations are required to store the values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConcurrentOpenHashSet.Builder<V>Builder of ConcurrentOpenHashSet.
-
Constructor Summary
Constructors Constructor Description ConcurrentOpenHashSet()Deprecated.ConcurrentOpenHashSet(int expectedItems)Deprecated.ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel)Deprecated.ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(V value)longcapacity()voidclear()booleancontains(V value)voidforEach(java.util.function.Consumer<? super V> processor)booleanisEmpty()static <V> ConcurrentOpenHashSet.Builder<V>newBuilder()booleanremove(V value)intremoveIf(java.util.function.Predicate<V> filter)longsize()java.lang.StringtoString()java.util.List<V>values()
-
-
-
Constructor Detail
-
ConcurrentOpenHashSet
@Deprecated public ConcurrentOpenHashSet()
Deprecated.
-
ConcurrentOpenHashSet
@Deprecated public ConcurrentOpenHashSet(int expectedItems)
Deprecated.
-
ConcurrentOpenHashSet
@Deprecated public ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel)Deprecated.
-
ConcurrentOpenHashSet
public ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
-
-
Method Detail
-
newBuilder
public static <V> ConcurrentOpenHashSet.Builder<V> newBuilder()
-
size
public long size()
-
capacity
public long capacity()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(V value)
-
add
public boolean add(V value)
-
remove
public boolean remove(V value)
-
clear
public void clear()
-
forEach
public void forEach(java.util.function.Consumer<? super V> processor)
-
removeIf
public int removeIf(java.util.function.Predicate<V> filter)
-
values
public java.util.List<V> values()
- Returns:
- a new list of all values (makes a copy)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-