1 package jalview.datamodel.features;
3 import java.util.HashMap;
7 * A singleton to hold metadata about feature attributes, keyed by a unique
8 * feature source identifier
13 public class FeatureSources
15 private static FeatureSources instance = new FeatureSources();
17 private Map<String, FeatureSourceI> sources;
20 * Answers the singleton instance of this class
24 public static FeatureSources getInstance()
29 private FeatureSources()
31 sources = new HashMap<>();
35 * Answers the FeatureSource with the given unique identifier, or null if not
41 public FeatureSourceI getSource(String sourceId)
43 return sources.get(sourceId);
47 * Adds the given source under the given key. This will replace any existing
48 * source with the same id, it is the caller's responsibility to ensure keys
49 * are unique if necessary.
54 public void addSource(String sourceId, FeatureSource source)
56 sources.put(sourceId, source);