mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-22 07:28:57 -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>
|
<priority>1</priority>
|
||||||
</email>
|
</email>
|
||||||
</user>
|
</user>
|
||||||
|
<<<<<<< HEAD
|
||||||
</alert>
|
</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