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 Stripecube Show documentation
Show all versions of Stripecube Show documentation
Stripecube is an open source Java framework for Web Applications
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);
}
}