Package grammar.output

Source Code of grammar.output.ApplicationPluginManager

package grammar.output;

import grammar.analysis.NounSuffixNounClassCorrelator;
import grammar.model.Language;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ApplicationPluginManager {
  private static Map<Language, ApplicationPluginManager> INSTANCE =
    new HashMap<Language, ApplicationPluginManager>();
 
  private final List<ApplicationPlugin> plugins =
    new ArrayList<ApplicationPlugin>();
 
  private ApplicationPluginManager(Language language) {
//    plugins.add(new ModelVerbGraphViewer()); // TODO factor out as plugin
    plugins.add(new NounSuffixNounClassCorrelator(language)); // also factor out
  }
 
  public static ApplicationPluginManager getInstance(Language language) {
    ApplicationPluginManager apm;
    if ((apm = INSTANCE.get(language)) == null)
      INSTANCE.put(language, apm = new ApplicationPluginManager(language));
    return apm;
  }
 
  public void register(ApplicationPlugin plugin) {
    plugins.add(plugin);
  }
 
  public List<ApplicationPlugin> getPlugins() {
    return Collections.unmodifiableList(plugins);
  }
}
TOP

Related Classes of grammar.output.ApplicationPluginManager

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.