K - the key of an objectV - the type of objectspublic final class Memcache<K extends Serializable,V extends Serializable> extends Object implements Cache<K,V>
Note:
removeAll() will clear all caches.| Modifier and Type | Field and Description |
|---|---|
private com.google.appengine.api.memcache.AsyncMemcacheService |
asyncMemcacheService
Asynchronous memcache service.
|
private static int |
FALSE_INT
Integer value for false flag.
|
private static Logger |
LOGGER
Logger.
|
private com.google.appengine.api.memcache.MemcacheService |
memcacheService
Memcache service.
|
private String |
name
Name of this cache.
|
private static int |
TRUE_INT
Integer value for true flag.
|
| Constructor and Description |
|---|
Memcache(String name)
Constructs a memcache with the specified name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
collect() |
boolean |
contains(K key) |
V |
get(K key) |
long |
getCachedBytes() |
long |
getCachedCount() |
long |
getHitBytes() |
long |
getHitCount() |
long |
getMaxCount() |
long |
getMissCount() |
String |
getName()
Gets the name of this cache.
|
long |
getPutCount() |
long |
inc(K key,
long delta) |
void |
put(K key,
V value) |
void |
putAsync(K key,
V value) |
void |
remove(Collection<K> keys) |
void |
remove(K key) |
void |
removeAll() |
void |
setMaxCount(long maxCount) |
private static final Logger LOGGER
private com.google.appengine.api.memcache.MemcacheService memcacheService
private com.google.appengine.api.memcache.AsyncMemcacheService asyncMemcacheService
private String name
private static final int TRUE_INT
private static final int FALSE_INT
public Memcache(String name)
name - the specified namepublic String getName()
public boolean contains(K key)
contains in interface Cache<K extends Serializable,V extends Serializable>public void put(K key, V value)
put in interface Cache<K extends Serializable,V extends Serializable>public void putAsync(K key, V value)
putAsync in interface Cache<K extends Serializable,V extends Serializable>public V get(K key)
get in interface Cache<K extends Serializable,V extends Serializable>public long inc(K key, long delta)
inc in interface Cache<K extends Serializable,V extends Serializable>public void remove(K key)
remove in interface Cache<K extends Serializable,V extends Serializable>public void remove(Collection<K> keys)
remove in interface Cache<K extends Serializable,V extends Serializable>public void removeAll()
removeAll in interface Cache<K extends Serializable,V extends Serializable>public void setMaxCount(long maxCount)
setMaxCount in interface Cache<K extends Serializable,V extends Serializable>public long getMaxCount()
getMaxCount in interface Cache<K extends Serializable,V extends Serializable>public long getHitCount()
getHitCount in interface Cache<K extends Serializable,V extends Serializable>public long getMissCount()
getMissCount in interface Cache<K extends Serializable,V extends Serializable>public long getPutCount()
getPutCount in interface Cache<K extends Serializable,V extends Serializable>public long getCachedBytes()
getCachedBytes in interface Cache<K extends Serializable,V extends Serializable>public long getHitBytes()
getHitBytes in interface Cache<K extends Serializable,V extends Serializable>public long getCachedCount()
getCachedCount in interface Cache<K extends Serializable,V extends Serializable>public void collect()
collect in interface Cache<K extends Serializable,V extends Serializable>Copyright © 2010–2016 B3log. All rights reserved.