[置顶] Android提供的LruCache类简介 分类:
Android开发 2013-02-06 15:26 11812人阅读 (7)
package android.util;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* A cache that holds strong references to a limited number of values. Each time
* a value is accessed, it is moved to the head of a queue. When a value is
* added to a full cache, the value at the end of that queue is evicted and may
* become eligible for garbage collection.
* Cache保存一个强引用来限制内容数量,每当Item被访问的时候,此Item就会移动到队列的头部。
* 当cache已满的时候加入新的item时,在队列尾部的item会被回收。
* <p>If your cached values hold resources that need to be explicitly released,
* override {@link #entryRemoved}.
* 如果你cache的某个值需要明确释放,重写entryRemoved()
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。