All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qiniu.android.dns.util.LruCache Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy