1 package jalview.datamodel.features;
3 import jalview.datamodel.SequenceFeature;
8 public interface SequenceFeaturesI
12 * Adds one sequence feature to the store, and returns true, unless the
13 * feature is already contained in the store, in which case this method
14 * returns false. Containment is determined by SequenceFeature.equals()
19 public abstract boolean add(SequenceFeature sf);
22 * Returns a (possibly empty) list of features, optionally restricted to
23 * specified types, which overlap the given (inclusive) sequence position
31 public abstract List<SequenceFeature> findFeatures(int from, int to,
35 * Answers a list of all features stored, optionally restricted to specified
36 * types, in no particular guaranteed order
41 public abstract List<SequenceFeature> getAllFeatures(String... type);
43 public abstract int getFeatureCount(boolean positional, String... type);
46 * Answers a list of all positional features, optionally restricted to
47 * specified types, in no particular guaranteed order
52 public abstract List<SequenceFeature> getPositionalFeatures(
56 * Answers a list of all contact features, optionally restricted to specified
57 * types, in no particular guaranteed order
61 public abstract List<SequenceFeature> getContactFeatures(String... type);
64 * Answers a list of all non-positional features, optionally restricted to
65 * specified types, in no particular guaranteed order
68 * if no type is specified, all are returned
71 public abstract List<SequenceFeature> getNonPositionalFeatures(
75 * Deletes the given feature from the store, returning true if it was found
76 * (and deleted), else false. This method makes no assumption that the feature
77 * is in the 'expected' place in the store, in case it has been modified since
82 public abstract boolean delete(SequenceFeature sf);
85 * Answers true if this store contains at least one feature, else false
89 public abstract boolean hasFeatures();
92 * Returns a set of the distinct feature groups present in the collection. The
93 * set may include null. The boolean parameter determines whether the groups
94 * for positional or for non-positional features are returned. The optional
95 * type parameter may be used to restrict to groups for specified feature
98 * @param positionalFeatures
102 public abstract Set<String> getFeatureGroups(boolean positionalFeatures,
106 * Answers the set of distinct feature types for which there is at least one
107 * feature with one of the given feature group(s). The boolean parameter
108 * determines whether the groups for positional or for non-positional features
111 * @param positionalFeatures
115 public abstract Set<String> getFeatureTypesForGroups(
116 boolean positionalFeatures, String... groups);
119 * Answers an immutable set of the distinct feature types for which a feature
123 public abstract Set<String> getFeatureTypes();