1 package jalview.datamodel.features;
3 import java.util.HashMap;
6 public class FeatureSources
8 private static FeatureSources instance = new FeatureSources();
10 private Map<String, FeatureSourceI> sources;
13 * Answers the singelton instance of this class
17 public static FeatureSources getInstance()
22 private FeatureSources()
24 sources = new HashMap<>();
28 * Answers the FeatureSource with the given unique identifier, or null if not
34 public FeatureSourceI getSource(String sourceId)
36 return sources.get(sourceId);
40 * Adds the given source under the given key. This will replace any existing
41 * source with the same id, it is the caller's responsibility to ensure keys
42 * are unique if necessary.
47 public void addSource(String sourceId, FeatureSource source)
49 sources.put(sourceId, source);