public class DataStructures extends Object
Constructor and Description |
---|
DataStructures() |
Modifier and Type | Method and Description |
---|---|
static <K,V> ConcurrentMap<K,V> |
getConcurrentMap()
Creates a new, empty map with a default initial capacity (16),
load factor (0.75) and concurrencyLevel (16).
|
static <K,V> ConcurrentMap<K,V> |
getConcurrentMap(int initialCapacity)
Creates a new, empty map with an initial table size
accommodating the specified number of elements without the need
to dynamically resize.
|
static <K,V> ConcurrentMap<K,V> |
getConcurrentMap(int initialCapacity,
float loadFactor,
int concurrencyLevel)
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 ). |
static <K,V> ConcurrentMap<K,V> |
getConcurrentMap(Map<? extends K,? extends V> map)
Creates a new map with the same mappings as the given map.
|
static <T> BlockingQueue<T> |
getLTQInstance() |
static <T> BlockingQueue<T> |
getLTQInstance(Class<T> t) |
public static <T> BlockingQueue<T> getLTQInstance()
public static <T> BlockingQueue<T> getLTQInstance(Class<T> t)
public static <K,V> ConcurrentMap<K,V> getConcurrentMap()
public static <K,V> ConcurrentMap<K,V> getConcurrentMap(Map<? extends K,? extends V> map)
m
- the mappublic static <K,V> ConcurrentMap<K,V> getConcurrentMap(int initialCapacity)
initialCapacity
- The implementation performs internal
sizing to accommodate this many elements.IllegalArgumentException
- if the initial capacity of
elements is negativepublic static <K,V> ConcurrentMap<K,V> getConcurrentMap(int initialCapacity, float loadFactor, int concurrencyLevel)
initialCapacity
), table
density (loadFactor
), and number of concurrently
updating threads (concurrencyLevel
).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 sizeconcurrencyLevel
- 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
nonpositiveCopyright © 2015 Oracle Corporation. All rights reserved.