com.github.bedrin.jdbc.sniffer.util.LruCache Maven / Gradle / Ivy
package com.github.bedrin.jdbc.sniffer.util;
import java.util.LinkedHashMap;
import java.util.Map;
public class LruCache extends LinkedHashMap {
private final int size;
public LruCache(int size) {
super(size, 0.75f, false);
this.size = size;
}
@Override
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > size;
}
}