Class DataStructures
- Since:
- 2.3
- Author:
- Gustav Trede, Marek Potociar
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default concurrency level calculated based on the number of available CPUs. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> ConcurrentMap<K, V> Deprecated.static <K,
V> ConcurrentMap<K, V> createConcurrentMap
(int initialCapacity) Deprecated.static <K,
V> ConcurrentMap<K, V> createConcurrentMap
(int initialCapacity, float loadFactor, int concurrencyLevel) Deprecated.static <K,
V> ConcurrentMap<K, V> createConcurrentMap
(Map<? extends K, ? extends V> map) Deprecated.static <E> BlockingQueue<E>
Deprecated.
-
Field Details
-
DEFAULT_CONCURENCY_LEVEL
public static final int DEFAULT_CONCURENCY_LEVELDefault concurrency level calculated based on the number of available CPUs.
-
-
Constructor Details
-
DataStructures
public DataStructures()
-
-
Method Details
-
createLinkedTransferQueue
Deprecated.Create an instance of aBlockingQueue
that is based onLinkedTransferQueue
implementation, available in JDK 7 and above.Originally, the method was used to provide backwards compatibility for JDK versions 6 and below. As those versions are now unsupported, callers should instantiate an
LinkedTransferQueue
directly instead of using this method.- Type Parameters:
E
- the type of elements held in the queue.- Returns:
- new instance of a
BlockingQueue
that is based onLinkedTransferQueue
implementation from JDK 7.
-
createConcurrentMap
Deprecated.Creates a new, empty map with a default initial capacity (16), load factor (0.75) and concurrencyLevel (16).The method was originally used to provide the
ConcurrentHashMapV8
, available in JDK 8 and above, for JDK 7 or earlier. As those versions are now unsupported, callers should instantiate anConcurrentHashMap
directly instead of using this method.- Returns:
- the map.
-
createConcurrentMap
@Deprecated public static <K,V> ConcurrentMap<K,V> createConcurrentMap(Map<? extends K, ? extends V> map) Deprecated.Creates a new map with the same mappings as the given map.The method was originally used to provide the
ConcurrentHashMapV8
, available in JDK 8 and above, for JDK 7 or earlier. As those versions are now unsupported, callers should instantiate anConcurrentHashMap
directly instead of using this method.- Parameters:
map
- the map.
-
createConcurrentMap
Deprecated.Creates a new, empty map with an initial table size accommodating the specified number of elements without the need to dynamically resize.The method was originally used to provide the
ConcurrentHashMapV8
, available in JDK 8 and above, for JDK 7 or earlier. As those versions are now unsupported, callers should instantiate anConcurrentHashMap
directly instead of using this method.- Parameters:
initialCapacity
- The implementation performs internal sizing to accommodate this many elements.- Throws:
IllegalArgumentException
- if the initial capacity of elements is negative.
-
createConcurrentMap
@Deprecated public static <K,V> ConcurrentMap<K,V> createConcurrentMap(int initialCapacity, float loadFactor, int concurrencyLevel) Deprecated.Creates a new, empty map with an initial table size based on the given number of elements (initialCapacity
), table density (loadFactor
), and number of concurrently updating threads (concurrencyLevel
).The method was originally used to provide the
ConcurrentHashMapV8
, available in JDK 8 and above, for JDK 7 or earlier. As those versions are now unsupported, callers should instantiate anConcurrentHashMap
directly instead of using this method.- Parameters:
initialCapacity
- the initial capacity. The implementation performs internal sizing to accommodate this many elements, given the specified load factor.loadFactor
- the load factor (table density) for establishing the initial table size.concurrencyLevel
- the estimated number of concurrently updating threads. The implementation may use this value as a sizing hint.- Throws:
IllegalArgumentException
- if the initial capacity is negative or the load factor or concurrencyLevel are not positive.
-