类 ConcurrentOpenHashSet<V>
- 类型参数:
V-
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.
WARN: method forEach do not guarantee thread safety, nor does the values method.
The forEach method is specifically designed for single-threaded usage. When iterating over a set
with concurrent writes, it becomes possible for new values to be either observed or not observed.
There is no guarantee that if we write value1 and value2, and are able to see value2, then we will also see value1.
It is crucial to understand that the results obtained from aggregate status methods such as values
are typically reliable only when the map is not undergoing concurrent updates from other threads.
When concurrent updates are involved, the results of these methods reflect transient states
that may be suitable for monitoring or estimation purposes, but not for program control.
-
嵌套类概要
嵌套类 -
构造器概要
构造器构造器说明已过时。ConcurrentOpenHashSet(int expectedItems) 已过时。ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel) 已过时。ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor) -
方法概要
-
构造器详细资料
-
ConcurrentOpenHashSet
已过时。 -
ConcurrentOpenHashSet
已过时。 -
ConcurrentOpenHashSet
已过时。 -
ConcurrentOpenHashSet
public ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
-
-
方法详细资料
-
newBuilder
-
size
public long size() -
capacity
public long capacity() -
isEmpty
public boolean isEmpty() -
contains
-
add
-
remove
-
clear
public void clear() -
forEach
Iterate over all the elements in the set and apply the provided function.Warning: Do Not Guarantee Thread-Safety.
- 参数:
processor- the function to apply to each element
-
removeIf
-
values
- 返回:
- a new list of all values (makes a copy)
-
toString
-