V
- the type of value taken and returned by this Map's underlying
transcoder, and thus taken and returned by this Map.public class BaseCacheMap<V>
extends java.lang.Object
implements java.util.Map<java.lang.String,V>
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.
Constructor and Description |
---|
BaseCacheMap(MemcachedClientIF c,
int expiration,
java.lang.String prefix,
Transcoder<V> t)
Build a BaseCacheMap.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value)
This method always returns false, as truth cannot be determined without
iteration.
|
java.util.Set<java.util.Map.Entry<java.lang.String,V>> |
entrySet() |
V |
get(java.lang.Object key) |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
V |
put(java.lang.String key,
V value) |
void |
putAll(java.util.Map<? extends java.lang.String,? extends V> t) |
V |
remove(java.lang.Object key) |
int |
size() |
java.util.Collection<V> |
values() |
public BaseCacheMap(MemcachedClientIF c, int expiration, java.lang.String prefix, Transcoder<V> t)
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 objectspublic void clear()
clear
in interface java.util.Map<java.lang.String,V>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,V>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,V>
public java.util.Set<java.util.Map.Entry<java.lang.String,V>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,V>
public V get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,V>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,V>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,V>
public void putAll(java.util.Map<? extends java.lang.String,? extends V> t)
putAll
in interface java.util.Map<java.lang.String,V>
public V remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,V>
public int size()
size
in interface java.util.Map<java.lang.String,V>
public java.util.Collection<V> values()
values
in interface java.util.Map<java.lang.String,V>
Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.