K - the type of keys maintained by this mapV - the type of mapped valuespublic class ConcurrentLinkedHashMap<K,V> extends Object implements Map<K,V>
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ConcurrentLinkedHashMap.MapEventListener<K,V>
The callback interface, when the some events(get, put, remove, eliminate) occur, the map will call it.
|
| 构造器和说明 |
|---|
ConcurrentLinkedHashMap(boolean accessOrder,
int maxEntries,
ConcurrentLinkedHashMap.MapEventListener<K,V> mapEventListener) |
ConcurrentLinkedHashMap(boolean accessOrder,
int maxEntries,
ConcurrentLinkedHashMap.MapEventListener<K,V> mapEventListener,
int concurrencyLevel) |
ConcurrentLinkedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder,
int maxEntries,
ConcurrentLinkedHashMap.MapEventListener<K,V> mapEventListener,
int concurrencyLevel) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
clear all map's entries, but it dosen't trigger the remove callback method
|
boolean |
containsKey(Object key)
Returns true, if this map contains a mapping for the specified key.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.
|
Set<Map.Entry<K,V>> |
entrySet()
Returns a
Set view of the mappings contained in this map. |
V |
get(Object key)
Returns a value which the specified key is mapped.
|
int |
getConcurrencyLevel()
Returns a value which represents the number of map's partition
|
int |
getSegmentMask()
Mask value for indexing into segments.
|
int |
getSegmentShift()
Shift value for indexing within segments.
|
boolean |
isEmpty()
Returns true, if the map doesn't contain any entry.
|
Set<K> |
keySet()
Gets the all key in this map.
|
V |
put(K key,
V value)
Associates the specified value with the specified key in this map.
|
void |
putAll(Map<? extends K,? extends V> m)
Puts another map into this map.
|
V |
remove(Object key)
Remove a entry from this map.
|
int |
size()
Gets the entry's total number.
|
String |
toString() |
Collection<V> |
values()
Returns a
Collection view of the values contained in this map. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic ConcurrentLinkedHashMap(boolean accessOrder,
int maxEntries,
ConcurrentLinkedHashMap.MapEventListener<K,V> mapEventListener)
accessOrder - the ordering mode - true for
access-order, false for insertion-ordermaxEntries - map's the biggest capacity, it isn't accurate,
the actual limit of capacity depends on the entry's number of every segment.
For example, if you set the max entries is 64, and the concurrency level is 16,
and then every segment's max entries is 64/16 = 4.mapEventListener - the callback method of map's operationspublic ConcurrentLinkedHashMap(boolean accessOrder,
int maxEntries,
ConcurrentLinkedHashMap.MapEventListener<K,V> mapEventListener,
int concurrencyLevel)
accessOrder - accessOrder the ordering mode - true for
access-order, false for insertion-ordermaxEntries - map's the biggest capacity, it isn't accurate,
the actual limit of capacity depends on the entry's number of every segment.
For example, if you set the max entries is 64, and the concurrency level is 16,
and then every segment's max entries is 64/16 = 4.mapEventListener - the callback method of map's operationsconcurrencyLevel - the number of segment, default is 16public ConcurrentLinkedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder,
int maxEntries,
ConcurrentLinkedHashMap.MapEventListener<K,V> mapEventListener,
int concurrencyLevel)
initialCapacity - map initial capacity in every segmentloadFactor - the load factor decide the map increase to what degree have to expand, default value is 0.75faccessOrder - the ordering mode - true for
access-order, false for insertion-ordermaxEntries - map's the biggest capacity, it isn't accurate,
the actual limit of capacity depends on the entry's number of every segment.
For example, if you set the max entries is 64, and the concurrency level is 16,
and then every segment's max entries is 64/16 = 4.mapEventListener - the callback method of map's operationsconcurrencyLevel - the number of segment, default is 16public boolean isEmpty()
public boolean containsKey(Object key)
containsKey 在接口中 Map<K,V>public boolean containsValue(Object value)
containsValue 在接口中 Map<K,V>public V get(Object key)
public V put(K key, V value)
put 在接口中 Map<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic void clear()
public Collection<V> values()
Collection view of the values contained in this map.public Set<Map.Entry<K,V>> entrySet()
Set view of the mappings contained in this map.public int getConcurrencyLevel()
public int getSegmentShift()
public int getSegmentMask()
Copyright © 2016. All rights reserved.