JAL-2374 new contains methods for seq and seq,apos
authorJim Procter <jprocter@issues.jalview.org>
Wed, 15 Feb 2017 15:41:58 +0000 (15:41 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 15 Feb 2017 15:41:58 +0000 (15:41 +0000)
src/jalview/datamodel/SequenceGroup.java

index 4f9d530..e37c55e 100755 (executable)
@@ -1411,4 +1411,24 @@ public class SequenceGroup implements AnnotatedCollectionI
     }
     return false;
   }
+
+  /**
+   * @param seq
+   * @return true if seq is a member of the group
+   */
+
+  public boolean contains(SequenceI seq1)
+  {
+    return sequences.contains(seq1);
+  }
+
+  /**
+   * @param seq
+   * @param apos
+   * @return true if startRes<=apos and endRes>=apos and seq is in the group
+   */
+  public boolean contains(SequenceI seq, int apos)
+  {
+    return (startRes <= apos && endRes >= apos) && sequences.contains(seq);
+  }
 }