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 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 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 abstract List<SequenceFeature> getAllFeatures(String... type);
44 * Answers the number of (positional or non-positional) features, optionally
45 * restricted to specified feature types. Contact features are counted as 1.
51 abstract int getFeatureCount(boolean positional, String... type);
54 * Answers the total length of positional features, optionally restricted to
55 * specified feature types. Contact features are counted as length 1.
60 abstract int getTotalFeatureLength(String... type);
63 * Answers a list of all positional features, optionally restricted to
64 * specified types, in no particular guaranteed order
69 abstract List<SequenceFeature> getPositionalFeatures(
73 * Answers a list of all contact features, optionally restricted to specified
74 * types, in no particular guaranteed order
78 abstract List<SequenceFeature> getContactFeatures(String... type);
81 * Answers a list of all non-positional features, optionally restricted to
82 * specified types, in no particular guaranteed order
85 * if no type is specified, all are returned
88 abstract List<SequenceFeature> getNonPositionalFeatures(
92 * Deletes the given feature from the store, returning true if it was found
93 * (and deleted), else false. This method makes no assumption that the feature
94 * is in the 'expected' place in the store, in case it has been modified since
99 abstract boolean delete(SequenceFeature sf);
102 * Answers true if this store contains at least one feature, else false
106 abstract boolean hasFeatures();
109 * Returns a set of the distinct feature groups present in the collection. The
110 * set may include null. The boolean parameter determines whether the groups
111 * for positional or for non-positional features are returned. The optional
112 * type parameter may be used to restrict to groups for specified feature
115 * @param positionalFeatures
119 abstract Set<String> getFeatureGroups(boolean positionalFeatures,
123 * Answers the set of distinct feature types for which there is at least one
124 * feature with one of the given feature group(s). The boolean parameter
125 * determines whether the groups for positional or for non-positional features
128 * @param positionalFeatures
132 abstract Set<String> getFeatureTypesForGroups(
133 boolean positionalFeatures, String... groups);
136 * Answers a set of the distinct feature types for which a feature is stored
140 abstract Set<String> getFeatureTypes();