|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectnet.tsz.afinal.common.MemoryLruCache<K,V>
public class MemoryLruCache<K,V>
| 构造方法摘要 | |
|---|---|
MemoryLruCache(int maxSize)
|
|
| 方法摘要 | |
|---|---|
int |
createCount()
Returns the number of times create(Object) returned a value. |
void |
evictAll()
Clear the cache, calling entryRemoved(boolean, K, V, V) on each removed entry. |
int |
evictionCount()
Returns the number of values that have been evicted. |
V |
get(K key)
Returns the value for key if it exists in the cache or can be
created by #create. |
int |
hitCount()
Returns the number of times get(K) returned a value. |
int |
maxSize()
For caches that do not override sizeOf(K, V), this returns the maximum
number of entries in the cache. |
int |
missCount()
Returns the number of times get(K) returned null or required a new
value to be created. |
V |
put(K key,
V value)
Caches value for key. |
int |
putCount()
Returns the number of times put(K, V) was called. |
V |
remove(K key)
Removes the entry for key if it exists. |
int |
size()
For caches that do not override sizeOf(K, V), this returns the number
of entries in the cache. |
java.util.Map<K,V> |
snapshot()
Returns a copy of the current contents of the cache, ordered from least recently accessed to most recently accessed. |
java.lang.String |
toString()
|
| 从类 java.lang.Object 继承的方法 |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
public MemoryLruCache(int maxSize)
maxSize - for caches that do not override sizeOf(K, V), this is
the maximum number of entries in the cache. For all other caches,
this is the maximum sum of the sizes of the entries in this cache.| 方法详细信息 |
|---|
public final V get(K key)
key if it exists in the cache or can be
created by #create. If a value was returned, it is moved to the
head of the queue. This returns null if a value is not cached and cannot
be created.
public final V put(K key,
V value)
value for key. The value is moved to the head of
the queue.
key.public final V remove(K key)
key if it exists.
key.public final void evictAll()
entryRemoved(boolean, K, V, V) on each removed entry.
public final int size()
sizeOf(K, V), this returns the number
of entries in the cache. For all other caches, this returns the sum of
the sizes of the entries in this cache.
public final int maxSize()
sizeOf(K, V), this returns the maximum
number of entries in the cache. For all other caches, this returns the
maximum sum of the sizes of the entries in this cache.
public final int hitCount()
get(K) returned a value.
public final int missCount()
get(K) returned null or required a new
value to be created.
public final int createCount()
create(Object) returned a value.
public final int putCount()
put(K, V) was called.
public final int evictionCount()
public final java.util.Map<K,V> snapshot()
public final java.lang.String toString()
java.lang.Object 中的 toString
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||