From 0585c8478eccc42896dbd1a4d365ecdc913551f2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 15 Feb 2017 15:41:58 +0000 Subject: [PATCH] JAL-2374 new contains methods for seq and seq,apos --- src/jalview/datamodel/SequenceGroup.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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); + } } -- 1.7.10.2