mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 04:09:45 +00:00
Change Permutation Filter
This commit is contained in:
1 parent
af55a6b191
commit
04f2f5af2c
21 files changed
+453
-251
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
// Simple LRUCache
|
||||
public class LRUCache<K, V> extends LinkedHashMap<K, V> {
|
||||
|
||||
private final int capacity;
|
||||
|
||||
public LRUCache(int capacity) {
|
||||
super(capacity, 0.75f, true);
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
|
||||
return size() > capacity;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user