Package net.spy.memcached
Class BaseCacheMap<V>
java.lang.Object
net.spy.memcached.BaseCacheMap<V>
- Type Parameters:
V
- the type of value taken and returned by this Map's underlying transcoder, and thus taken and returned by this Map.
- Direct Known Subclasses:
CacheMap
Base class for a Map interface to memcached.
This Map interface makes memcached a bit easier to use for some purposes by providing a limited Map implementation.
Do note that nothing that iterates over the map will work (such is memcached). All iteration mechanisms will return empty iterators and such.
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MemcachedClientIF
private final int
private final String
private final Transcoder
<V> -
Constructor Summary
ConstructorsConstructorDescriptionBaseCacheMap
(MemcachedClientIF c, int expiration, String prefix, Transcoder<V> t) Build a BaseCacheMap. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
keyPrefix
-
transcoder
-
client
-
exp
private final int exp
-
-
Constructor Details
-
BaseCacheMap
Build a BaseCacheMap.- Parameters:
c
- the underlying clientexpiration
- the expiration for objects set through this Mapprefix
- a prefix to ensure objects in this map are uniquet
- the transcoder to serialize and deserialize objects
-
-
Method Details
-
clear
public void clear() -
getKey
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,
V>
-
containsValue
This method always returns false, as truth cannot be determined without iteration.- Specified by:
containsValue
in interfaceMap<String,
V>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
putAll
-
remove
-
size
public int size() -
values
-
put
-