com.qiniu.android.dns.util.LruCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of happy-dns Show documentation
Show all versions of happy-dns Show documentation
Qiniu Happy Dns for Android
package com.qiniu.android.dns.util;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Created by bailong on 15/6/18.
*/
public final class LruCache extends LinkedHashMap {
private int size;
public LruCache() {
this(256);
}
public LruCache(int size) {
super(size, 1.0f, true);
this.size = size;
}
protected boolean removeEldestEntry(Map.Entry eldest) {
return this.size() > this.size;
}
}