From: Jim Procter Date: Wed, 15 Feb 2017 15:41:58 +0000 (+0000) Subject: JAL-2374 new contains methods for seq and seq,apos X-Git-Tag: Release_2_10_3b1~344^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0585c8478eccc42896dbd1a4d365ecdc913551f2;p=jalview.git JAL-2374 new contains methods for seq and seq,apos --- diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 4f9d530..e37c55e 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -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); + } }