equivalent-exchange-3/common/com/pahimar/ee3/emc/EmcMap.java

38 lines
733 B
Java
Raw Normal View History

2013-08-23 16:59:50 +02:00
package com.pahimar.ee3.emc;
import java.util.HashMap;
import com.pahimar.ee3.item.CustomWrappedStack;
public class EmcMap {
private static EmcMap emcMap = null;
private HashMap<CustomWrappedStack, EmcValue> emcMappings;
private EmcMap() {
emcMappings = new HashMap<CustomWrappedStack, EmcValue>();
}
public static EmcMap getInstance() {
if (emcMap == null) {
emcMap = new EmcMap();
}
return emcMap;
}
public EmcValue getEmcValue(Object object) {
EmcValue emcValue = null;
if (CustomWrappedStack.canBeWrapped(object)) {
return emcMappings.get(new CustomWrappedStack(object));
}
return emcValue;
}
}