1 package jalview.datamodel.features;
3 import jalview.datamodel.SequenceFeature;
5 import java.util.Collections;
6 import java.util.HashMap;
10 public class SequenceFeatures
14 * map from feature type to structured store of features for that type
16 private Map<String, FeatureStore> featureStore;
21 public SequenceFeatures()
23 featureStore = new HashMap<String, FeatureStore>();
27 * Add one sequence feature to the store
31 public void add(SequenceFeature sf)
33 String type = sf.getType();
34 if (featureStore.get(type) == null)
36 featureStore.put(type, new FeatureStore());
38 featureStore.get(type).addFeature(sf);
42 * Returns a (possibly empty) list of features of the given type which overlap
43 * the (inclusive) sequence position range
50 public List<SequenceFeature> findFeatures(String type, int from,
53 FeatureStore features = featureStore.get(type);
56 return Collections.emptyList();
58 return features.findOverlappingFeatures(from, to);