| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<K,com.dexcoder.commons.cache.AbstractCacheMap.CacheObject<K,V>> |
cacheMap
缓存map
|
protected int |
cacheSize
最大缓存大小 , 0表示无限制
|
protected long |
defaultExpire
默认过期时间, 0表示永不过期
|
protected boolean |
existCustomExpire
是否设置默认过期时间
|
| 构造器和说明 |
|---|
AbstractCacheMap(int cacheSize,
long defaultExpire)
构造方法
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
清空缓存
|
int |
eliminate()
回收对象
|
protected abstract int |
eliminateCache()
淘汰对象具体实现
|
V |
get(K key)
获取缓存对象
|
int |
getCacheSize()
获取最大缓存大小
|
long |
getDefaultExpire()
获取默认过期时间
|
boolean |
isEmpty()
缓存是否为空
|
boolean |
isFull()
缓存是否已满
|
protected boolean |
isNeedClearExpiredObject()
是否需要清除过期对象
|
void |
put(K key,
V value)
添加缓存对象
|
void |
put(K key,
V value,
long expire)
添加缓存对象
|
void |
remove(K key)
移除缓存对象
|
int |
size()
缓存大小
|
protected Map<K,com.dexcoder.commons.cache.AbstractCacheMap.CacheObject<K,V>> cacheMap
protected int cacheSize
protected long defaultExpire
protected boolean existCustomExpire
public AbstractCacheMap(int cacheSize,
long defaultExpire)
cacheSize - defaultExpire - public int getCacheSize()
getCacheSize 在接口中 CacheMap<K,V>public long getDefaultExpire()
getDefaultExpire 在接口中 CacheMap<K,V>protected boolean isNeedClearExpiredObject()
protected abstract int eliminateCache()
Copyright © 2016. All rights reserved.