
com.orientechnologies.common.factory.ODynamicFactoryInverse Maven / Gradle / Ivy
The newest version!
package com.orientechnologies.common.factory;
import java.util.HashMap;
import java.util.Map;
public class ODynamicFactoryInverse extends ODynamicFactory {
protected Map inverseRegistry = new HashMap();
public K getInverse(V iValue) {
return inverseRegistry.get(iValue);
}
@Override
public void register(K iKey, V iValue) {
super.register(iKey, iValue);
inverseRegistry.put(iValue, iKey);
}
@Override
public void unregister(K iKey) {
V value = get(iKey);
if (value == null)
return;
super.unregister(iKey);
inverseRegistry.remove(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy