com.clickntap.tool.cache.MemoryLruMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of click_framework Show documentation
Show all versions of click_framework Show documentation
Java Framework based on Spring Framework, Freemarker and Simplicity
The newest version!
package com.clickntap.tool.cache;
import java.util.LinkedHashMap;
public class MemoryLruMap extends LinkedHashMap {
private int capacity;
public MemoryLruMap(int capacity) {
super(capacity + 1, 1.0f, true);
this.capacity = capacity;
}
protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
return (size() > this.capacity);
}
}