public final class DataStructures extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONCURENCY_LEVEL
Default concurrency level calculated based on the number of available CPUs.
|
| Constructor and Description |
|---|
DataStructures() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> ConcurrentMap<K,V> |
createConcurrentMap()
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> |
createLinkedTransferQueue()
Deprecated.
|
public static final int DEFAULT_CONCURENCY_LEVEL
@Deprecated public static <E> BlockingQueue<E> createLinkedTransferQueue()
BlockingQueue that is based on
LinkedTransferQueue 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.
E - the type of elements held in the queue.BlockingQueue that is based on LinkedTransferQueue
implementation from JDK 7.@Deprecated public static <K,V> ConcurrentMap<K,V> createConcurrentMap()
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 an ConcurrentHashMap
directly instead of using this method.
@Deprecated public static <K,V> ConcurrentMap<K,V> createConcurrentMap(Map<? extends K,? extends V> 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 an ConcurrentHashMap
directly instead of using this method.
map - the map.@Deprecated public static <K,V> ConcurrentMap<K,V> createConcurrentMap(int initialCapacity)
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 an ConcurrentHashMap
directly instead of using this method.
initialCapacity - The implementation performs internal
sizing to accommodate this many elements.IllegalArgumentException - if the initial capacity of
elements is negative.@Deprecated public static <K,V> ConcurrentMap<K,V> createConcurrentMap(int initialCapacity, float loadFactor, int concurrencyLevel)
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 an ConcurrentHashMap
directly instead of using this method.
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.IllegalArgumentException - if the initial capacity is
negative or the load factor or concurrencyLevel are
not positive.Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.