Created
September 17, 2010 21:04
-
-
Save peas/584956 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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