de.intarsys.tools.functor.StandardFunctorOutlet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isrt Show documentation
Show all versions of isrt Show documentation
The basic runtime tools and interfaces for intarsys components.
package de.intarsys.tools.functor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class StandardFunctorOutlet implements IFunctorOutlet {
private Map factories = new HashMap();
public List getFunctorFactories() {
return new ArrayList(factories.values());
}
public IFunctorFactory lookupFunctorFactory(String id) {
if (id == null) {
return null;
}
return factories.get(id);
}
public void registerFunctorFactory(String id, IFunctorFactory factory) {
factories.put(id, factory);
}
public void unregisterFunctorFactory(IFunctorFactory factory) {
for (Iterator it = factories.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
if (entry.getValue() == factory) {
it.remove();
return;
}
}
factories.remove(factory);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy