org.mentawai.cache
Class AbstractCache
java.lang.Object
org.mentawai.cache.AbstractCache
- All Implemented Interfaces:
- Serializable, Cache
- Direct Known Subclasses:
- FIFOCache, LRUCache, TimeoutCache
public abstract class AbstractCache
- extends Object
- implements Cache, Serializable
- See Also:
- Serialized Form
LOAD
protected static final float LOAD
- See Also:
- Constant Field Values
name
protected final String name
map
protected final Map<Object,Object> map
capacity
protected final int capacity
misses
protected transient volatile int misses
hits
protected transient volatile int hits
startDate
protected final transient Date startDate
AbstractCache
public AbstractCache(String name,
int capacity)
AbstractCache
public AbstractCache(String name,
int capacity,
float load)
createMap
protected abstract Map<Object,Object> createMap(int initialCapacity,
float load)
remove
public Object remove(Object key)
- Specified by:
remove in interface Cache
get
public Object get(Object key)
- Specified by:
get in interface Cache
put
public Object put(Object key,
Object value)
- Specified by:
put in interface Cache
clear
public void clear()
- Specified by:
clear in interface Cache
getSize
public int getSize()
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2012. All Rights Reserved.