Skip to content

Instantly share code, notes, and snippets.

@peas
Created September 17, 2010 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peas/584956 to your computer and use it in GitHub Desktop.
Save peas/584956 to your computer and use it in GitHub Desktop.
class LRUCache extends LinkedHashMap<String, String> {
private int tamanho;
public LRUCache(int tamanho) {
super(3, 0.75f, true);
this.tamanho = tamanho;
}
protected boolean removeEldestEntry(
java.util.Map.Entry<String, String> eldest) {
return this.size() > tamanho;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment