![JAR search and dependency download from the Maven repository](/logo.png)
eu.project.ttc.tools.TermSuiteResourceManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of termsuite-core Show documentation
Show all versions of termsuite-core Show documentation
A Java UIMA-based toolbox for multilingual and efficient terminology extraction an multilingual term alignment
package eu.project.ttc.tools;
import java.util.Map;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
public class TermSuiteResourceManager {
private static TermSuiteResourceManager instance;
private Map resources = Maps.newHashMap();
private TermSuiteResourceManager() {
}
public static TermSuiteResourceManager getInstance() {
if(instance == null)
instance = new TermSuiteResourceManager();
return instance;
}
public void register(String resourceName, Object resource) {
Preconditions.checkArgument(
!this.resources.containsKey(resourceName),
"Resource already registered: %s",
resourceName);
this.resources.put(resourceName, resource);
}
public Object get(String resourceName) {
Preconditions.checkArgument(
this.resources.containsKey(resourceName),
"No such resource: %s",
resourceName);
return this.resources.get(resourceName);
}
public boolean contains(String resourceName) {
return this.resources.containsKey(resourceName);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy