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.
All Implemented Interfaces:
Map<String,V>
Direct Known Subclasses:
CacheMap

public class BaseCacheMap<V> extends Object implements Map<String,V>
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.

  • Field Details

    • keyPrefix

      private final String keyPrefix
    • transcoder

      private final Transcoder<V> transcoder
    • client

      private final MemcachedClientIF client
    • exp

      private final int exp
  • Constructor Details

    • BaseCacheMap

      public BaseCacheMap(MemcachedClientIF c, int expiration, String prefix, Transcoder<V> t)
      Build a BaseCacheMap.
      Parameters:
      c - the underlying client
      expiration - the expiration for objects set through this Map
      prefix - a prefix to ensure objects in this map are unique
      t - the transcoder to serialize and deserialize objects
  • Method Details