| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractCache(int maxCapacity,
long evictExpiredInterval) |
protected |
AbstractCache(int maxCapacity,
long evictExpiredInterval,
Timer timer) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract void |
addToCache(Entry<K,V> entry) |
protected abstract void |
afterRead(Entry<K,V> entry) |
protected abstract void |
afterRecomputeExpireTimeOnRead(Entry<K,V> entry) |
protected abstract void |
beforeRead(Entry<K,V> entry) |
protected abstract void |
beforeRecomputeExpireTimeOnRead(Entry<K,V> entry) |
void |
clean() |
protected abstract List<K> |
forceEvict(int count)
用于找到将被强制清除的
|
V |
get(K key)
get by key
|
V |
get(K key,
Supplier<K,V> loader) |
Map<K,V> |
getAll(Iterable<K> keys)
multiple get
|
Map<K,V> |
getAllIfPresent(Iterable<K> keys)
multiple get
|
V |
getIfPresent(K key) |
protected void |
incrementUsedCount(Entry<K,V> entry) |
void |
refresh(K key) |
List<V> |
remove(Collection<K> keys) |
V |
remove(K key) |
protected V |
remove(K key,
RemoveCause cause) |
protected abstract void |
removeFromCache(Entry<K,V> entry,
RemoveCause removeCause) |
void |
set(K key,
V value)
set a key-value to cache, with out expire time never
|
void |
set(K key,
V value,
long expire)
set a key-value to cache, with the specified expire time
|
void |
set(K key,
V value,
long duration,
TimeUnit timeUnit)
set a key-value to cache, with the specified expire time
|
void |
setKeyReferenceType(ReferenceType keyReferenceType) |
void |
setReferenceQueue(ReferenceQueue referenceQueue) |
void |
setTimer(Timer timer) |
void |
setValueReferenceType(ReferenceType valueReferenceType) |
void |
shutdown() |
int |
size() |
void |
startup() |
Map<K,V> |
toMap() |
protected AbstractCache(int maxCapacity,
long evictExpiredInterval)
protected AbstractCache(int maxCapacity,
long evictExpiredInterval,
Timer timer)
public void setKeyReferenceType(ReferenceType keyReferenceType)
public void setValueReferenceType(ReferenceType valueReferenceType)
public void setReferenceQueue(ReferenceQueue referenceQueue)
public void set(@NonNull K key, @Nullable V value)
Cachepublic void set(@NonNull K key, @Nullable V value, long duration, TimeUnit timeUnit)
Cachepublic void set(@NonNull K key, @Nullable V value, long expire)
Cachepublic Map<K,V> getAllIfPresent(Iterable<K> keys)
CachegetAllIfPresent 在接口中 Cache<K,V>keys - get the specified keysprotected abstract void beforeRecomputeExpireTimeOnRead(Entry<K,V> entry)
protected abstract void afterRecomputeExpireTimeOnRead(Entry<K,V> entry)
protected abstract void removeFromCache(Entry<K,V> entry, RemoveCause removeCause)
protected final V remove(@NonNull K key, @NonNull RemoveCause cause)
public void setTimer(Timer timer)
Copyright © 2020. All rights reserved.