mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-21 23:18:52 -05:00
Merge remote branch 'upstream/master'
Conflicts: GameServer/alert-config.xml GameServer/src/org/moparscape/msc/gs/model/mini/CacheObject.java ...
This commit is contained in:
commit
7fb4b90387
@ -22,5 +22,9 @@
|
||||
<priority>1</priority>
|
||||
</email>
|
||||
</user>
|
||||
<<<<<<< HEAD
|
||||
</alert>
|
||||
|
||||
=======
|
||||
</alert>
|
||||
>>>>>>> upstream/master
|
||||
|
27
GameServer/src/org/moparscape/msc/gs/Cache.java
Normal file
27
GameServer/src/org/moparscape/msc/gs/Cache.java
Normal file
@ -0,0 +1,27 @@
|
||||
package org.moparscape.msc.gs;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections.map.LRUMap;
|
||||
|
||||
/**
|
||||
* A basic cache backed by a {@link LRUMap}.
|
||||
*
|
||||
* @author CodeForFame
|
||||
*
|
||||
*/
|
||||
public class Cache<K, V> {
|
||||
|
||||
// Shitty commons and their failure to support generics...
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<K, V> cache = new LRUMap();
|
||||
|
||||
public V get(K key) {
|
||||
return cache.get(key);
|
||||
}
|
||||
|
||||
public void put(K key, V value) {
|
||||
cache.put(key, value);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user