Add check if sequence already exists
authoramwaterhouse <Andrew Waterhouse>
Fri, 24 Mar 2006 15:31:42 +0000 (15:31 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 24 Mar 2006 15:31:42 +0000 (15:31 +0000)
src/jalview/datamodel/Sequence.java

index 87a9306..f593226 100755 (executable)
@@ -153,6 +153,14 @@ public class Sequence implements SequenceI
         sequenceFeatures = new SequenceFeature[0];\r
       }\r
 \r
+      for(int i=0; i<sequenceFeatures.length; i++)\r
+      {\r
+        if(sequenceFeatures[i].equals(sf))\r
+        {\r
+          return;\r
+        }\r
+      }\r
+\r
       SequenceFeature [] temp = new SequenceFeature[sequenceFeatures.length+1];\r
       System.arraycopy(sequenceFeatures, 0, temp, 0, sequenceFeatures.length);\r
       temp[sequenceFeatures.length] = sf;\r