K
- the type of keys maintained by this mapV
- the type of mapped valuespublic class ConcurrentHashMapWithTimedEviction<K,V> extends ConcurrentMapWithTimedEvictionDecorator<K,V> implements ConcurrentMapWithTimedEviction<K,V>
ConcurrentMapWithTimedEviction
which conforms to the
ConcurrentHashMap
specification. This class is a
simple extension of ConcurrentMapWithTimedEvictionDecorator
which
always uses an instance of ConcurrentHashMap
as
a delegate. For convenience, it provides a number of overloaded constructors
which correspond to the constructors provided by the
ConcurrentHashMap
class.
Like ConcurrentHashMap
, this class does
not allow null to be used as a key or value.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ConcurrentHashMapWithTimedEviction()
Creates a new, empty map that supports timed entry eviction with a
default initial capacity (16), load factor (0.75), concurrencyLevel (16),
and eviction scheduler.
|
ConcurrentHashMapWithTimedEviction(EvictionScheduler<K,V> scheduler)
Creates a new, empty map that supports timed entry eviction with the
specified eviction scheduler, and with the default, initial capacity
(16), load factor (0.75) and concurrencyLevel (16).
|
ConcurrentHashMapWithTimedEviction(int initialCapacity)
Creates a new, empty map that supports timed entry eviction with the
specified initial capacity, and with the default load factor (0.75),
concurrencyLevel (16), and eviction scheduler.
|
ConcurrentHashMapWithTimedEviction(int initialCapacity,
EvictionScheduler<K,V> scheduler)
Creates a new, empty map that supports timed entry eviction with the
specified initial capacity and eviction scheduler, and with the default
load factor (0.75) and concurrencyLevel (16).
|
ConcurrentHashMapWithTimedEviction(int initialCapacity,
float loadFactor)
Creates a new, empty map that supports timed entry eviction with the
specified initial capacity and load factor, and with the default
concurrencyLevel (16) and eviction scheduler.
|
ConcurrentHashMapWithTimedEviction(int initialCapacity,
float loadFactor,
EvictionScheduler<K,V> scheduler)
Creates a new, empty map that supports timed entry eviction with the
specified initial capacity, load factor and eviction scheduler, and with
the default concurrencyLevel (16).
|
ConcurrentHashMapWithTimedEviction(int initialCapacity,
float loadFactor,
int concurrencyLevel)
Creates a new, empty map that supports timed entry eviction with the
specified initial capacity, load factor, and concurrency level, and with
the default eviction scheduler.
|
ConcurrentHashMapWithTimedEviction(int initialCapacity,
float loadFactor,
int concurrencyLevel,
EvictionScheduler<K,V> scheduler)
Creates a new, empty map that supports timed entry eviction with the
specified initial capacity, load factor, concurrency level, and eviction
scheduler.
|
clear, containsKey, containsValue, entrySet, get, keySet, put, put, putIfAbsent, putIfAbsent, remove, remove, replace, replace, replace, replace, size
clone, equals, hashCode, isEmpty, putAll, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
put, putIfAbsent, replace, replace
putIfAbsent, remove, replace, replace
public ConcurrentHashMapWithTimedEviction(int initialCapacity, float loadFactor, int concurrencyLevel, EvictionScheduler<K,V> scheduler)
initialCapacity
- the initial capacity. The implementation performs internal
sizing to accommodate this many elements.loadFactor
- the load factor threshold, used to control resizing. Resizing
may be performed when the average number of elements per bin
exceeds this threshold.concurrencyLevel
- the estimated number of concurrently updating threads. The
implementation performs internal sizing to try to accommodate
this many threads.scheduler
- the scheduler used for automatically evicting entries when the
time they are allowed to stay in the map has elapsed.IllegalArgumentException
- if the initial capacity is negative or the load factor or
concurrencyLevel are non-positive.public ConcurrentHashMapWithTimedEviction(int initialCapacity, float loadFactor, int concurrencyLevel)
initialCapacity
- the initial capacity. The implementation performs internal
sizing to accommodate this many elements.loadFactor
- the load factor threshold, used to control resizing. Resizing
may be performed when the average number of elements per bin
exceeds this threshold.concurrencyLevel
- the estimated number of concurrently updating threads. The
implementation performs internal sizing to try to accommodate
this many threads.IllegalArgumentException
- if the initial capacity is negative or the load factor or
concurrencyLevel are non-positive.public ConcurrentHashMapWithTimedEviction(int initialCapacity, float loadFactor, EvictionScheduler<K,V> scheduler)
initialCapacity
- the initial capacity. The implementation performs internal
sizing to accommodate this many elements.loadFactor
- the load factor threshold, used to control resizing. Resizing
may be performed when the average number of elements per bin
exceeds this threshold.scheduler
- the scheduler used for automatically evicting entries when the
time they are allowed to stay in the map has elapsed.IllegalArgumentException
- if the initial capacity of elements is negative or the load
factor is non-positivepublic ConcurrentHashMapWithTimedEviction(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity. The implementation performs internal
sizing to accommodate this many elements.loadFactor
- the load factor threshold, used to control resizing. Resizing
may be performed when the average number of elements per bin
exceeds this threshold.IllegalArgumentException
- if the initial capacity of elements is negative or the load
factor is non-positivepublic ConcurrentHashMapWithTimedEviction(int initialCapacity, EvictionScheduler<K,V> scheduler)
initialCapacity
- the initial capacity. The implementation performs internal
sizing to accommodate this many elements.scheduler
- the scheduler used for automatically evicting entries when the
time they are allowed to stay in the map has elapsed.IllegalArgumentException
- if the initial capacity of elements is negativepublic ConcurrentHashMapWithTimedEviction(int initialCapacity)
initialCapacity
- the initial capacity. The implementation performs internal
sizing to accommodate this many elements.IllegalArgumentException
- if the initial capacity of elements is negativepublic ConcurrentHashMapWithTimedEviction(EvictionScheduler<K,V> scheduler)
scheduler
- the scheduler used for automatically evicting entries when the
time they are allowed to stay in the map has elapsed.public ConcurrentHashMapWithTimedEviction()
Copyright © 2012–2016. All rights reserved.