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

org.polyfillservice.api.components.LRUCache Maven / Gradle / Ivy

The newest version!
package org.polyfillservice.api.components;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by smo on 6/8/17.
 */
public class LRUCache extends LinkedHashMap {

    private int cacheSize;

    public LRUCache(int cacheSize) {
        super(16, 0.75F, true);
        this.cacheSize = cacheSize;
    }

    protected boolean removeEldestEntry(Map.Entry eldest) {
        return size() >= cacheSize;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy