1 package jalview.datamodel.features;
3 import jalview.bin.Instance;
5 import java.util.HashMap;
8 public class FeatureSources
11 public static FeatureSources getInstance()
13 Instance i = Instance.getInstance();
14 return (i.featureSources == null
15 ? i.featureSources = new FeatureSources()
19 private Map<String, FeatureSourceI> sources;
21 private FeatureSources()
23 sources = new HashMap<>();
27 * Answers the FeatureSource with the given unique identifier, or null if not
33 public FeatureSourceI getSource(String sourceId)
35 return sources.get(sourceId);
39 * Adds the given source under the given key. This will replace any existing
40 * source with the same id, it is the caller's responsibility to ensure keys
41 * are unique if necessary.
46 public void addSource(String sourceId, FeatureSource source)
48 sources.put(sourceId, source);