Class MapContainer
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<Object,Object>
org.castor.cache.hashbelt.container.MapContainer
- All Implemented Interfaces:
Serializable
,ConcurrentMap<Object,
,Object> Map<Object,
,Object> Container
A very basic, HashMap-based implementation of the hashmap container strategy,
using nothing more than a basic hashmap to store key/value pairs. This works
well for lots of gets and a reasonably high volume of removes; if few removes
are required, and iterators are important to your particluar use-case of the
cache, it's better to use the FastIteratingContainer, which can handle
iterating at a higher speed, still has a map for accessing hash values, but has
a higher removal cost.
- Since:
- 1.0
- Version:
- $Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Gregory Block, Ralf Joachim
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,
V extends Object> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the timestamp of this container.Returns an iterator over the keys contained in this container.void
Set the timestamp of this container to System.currentTimeMillis().Returns an iterator over the values contained in this container.Methods inherited from class java.util.concurrent.ConcurrentHashMap
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
Methods inherited from class java.util.AbstractMap
clone
-
Constructor Details
-
MapContainer
public MapContainer()
-
-
Method Details
-
updateTimestamp
public void updateTimestamp()Set the timestamp of this container to System.currentTimeMillis().- Specified by:
updateTimestamp
in interfaceContainer
-
getTimestamp
public long getTimestamp()Returns the timestamp of this container.- Specified by:
getTimestamp
in interfaceContainer
- Returns:
- The timestamp.
-
keyIterator
Returns an iterator over the keys contained in this container. If the container is modified while an iteration is in progress, the results of the iteration is not affected and vice-versa.- Specified by:
keyIterator
in interfaceContainer
- Returns:
- An iterator over the keys currently contained in the container.
-
valueIterator
Returns an iterator over the values contained in this container. If the container is modified while an iteration is in progress, the results of the iteration is not affected and vice-versa.- Specified by:
valueIterator
in interfaceContainer
- Returns:
- An iterator over the values currently contained in the container.
-