net.spy.memcached
Class CacheMap

java.lang.Object
  extended by net.spy.memcached.BaseCacheMap<Object>
      extended by net.spy.memcached.CacheMap
All Implemented Interfaces:
Map<String,Object>

public class CacheMap
extends BaseCacheMap<Object>

A Map interface to memcached.

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
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
CacheMap(MemcachedClientIF c, int expiration, String prefix)
          Construct a CacheMap over the given MemcachedClient.
CacheMap(MemcachedClientIF c, String prefix)
          Construct a CacheMap over the given MemcachedClient with no expiration.
 
Method Summary
 
Methods inherited from class net.spy.memcached.BaseCacheMap
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
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
equals, hashCode
 

Constructor Detail

CacheMap

public CacheMap(MemcachedClientIF c,
                int expiration,
                String prefix)
Construct a CacheMap over the given MemcachedClient.

Parameters:
c - the client
expiration - the expiration to set for keys written to the cache
prefix - a prefix used to make keys in this map unique

CacheMap

public CacheMap(MemcachedClientIF c,
                String prefix)
Construct a CacheMap over the given MemcachedClient with no expiration.

Keys written into this Map will only expire when the LRU pushes them out.

Parameters:
c - the client
prefix - a prefix used to make keys in this map unique