JAL-2480 include sequenceFeatureStore in createDatasetSequence
[jalview.git] / src / jalview / datamodel / SequenceI.java
index aec68ab..6c82bf3 100755 (executable)
@@ -20,6 +20,8 @@
  */
 package jalview.datamodel;
 
+import jalview.datamodel.features.SequenceFeaturesI;
+
 import java.util.List;
 import java.util.Vector;
 
@@ -267,6 +269,13 @@ public interface SequenceI extends ASequenceI
   public SequenceFeature[] getSequenceFeatures();
 
   /**
+   * Answers the object holding features for the sequence
+   * 
+   * @return
+   */
+  SequenceFeaturesI getFeatures();
+
+  /**
    * Replaces the array of sequence features associated with this sequence with
    * a new array reference. If this sequence has a dataset sequence, then this
    * method will update the dataset sequence's feature array
@@ -337,7 +346,14 @@ public interface SequenceI extends ASequenceI
    */
   public void addDBRef(DBRefEntry entry);
 
-  public void addSequenceFeature(SequenceFeature sf);
+  /**
+   * Adds the given sequence feature and returns true, or returns false if it is
+   * already present on the sequence, or if the feature type is null.
+   * 
+   * @param sf
+   * @return
+   */
+  public boolean addSequenceFeature(SequenceFeature sf);
 
   public void deleteFeature(SequenceFeature sf);
 
@@ -468,4 +484,16 @@ public interface SequenceI extends ASequenceI
    *         list
    */
   public List<DBRefEntry> getPrimaryDBRefs();
+
+  /**
+   * Returns a (possibly empty) list of sequence features that overlap the range
+   * from-to (inclusive), optionally restricted to one or more specified feature
+   * types
+   * 
+   * @param from
+   * @param to
+   * @param types
+   * @return
+   */
+  List<SequenceFeature> findFeatures(int from, int to, String... types);
 }