Features are now an array, not vector
authoramwaterhouse <Andrew Waterhouse>
Fri, 24 Feb 2006 11:38:44 +0000 (11:38 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 24 Feb 2006 11:38:44 +0000 (11:38 +0000)
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceI.java

index d35a05b..48057b8 100755 (executable)
@@ -47,7 +47,7 @@ public class Sequence implements SequenceI
     Vector annotation;\r
 \r
     /** DOCUMENT ME!! */\r
-    public Vector sequenceFeatures;\r
+    public SequenceFeature [] sequenceFeatures;\r
 \r
     /**\r
      * Creates a new Sequence object.\r
@@ -136,25 +136,40 @@ public class Sequence implements SequenceI
      *\r
      * @param v DOCUMENT ME!\r
      */\r
-    public void setSequenceFeatures(Vector v)\r
+    public void setSequenceFeatures(SequenceFeature [] features)\r
     {\r
-        sequenceFeatures = v;\r
+        sequenceFeatures = features;\r
     }\r
 \r
     public void addSequenceFeature(SequenceFeature sf)\r
     {\r
       if(sequenceFeatures==null)\r
-        sequenceFeatures = new Vector();\r
+      {\r
+        sequenceFeatures = new SequenceFeature[0];\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
 \r
-      sequenceFeatures.addElement(sf);\r
+\r
+      sequenceFeatures = temp;\r
     }\r
 \r
+    SequenceFeature [] sfarray;\r
+\r
+        public SequenceFeature[] getsfarray()\r
+        {\r
+          return sfarray;\r
+        }\r
+\r
+\r
     /**\r
      * DOCUMENT ME!\r
      *\r
      * @return DOCUMENT ME!\r
      */\r
-    public Vector getSequenceFeatures()\r
+    public SequenceFeature [] getSequenceFeatures()\r
     {\r
         return sequenceFeatures;\r
     }\r
index 21f7cc4..089a5f6 100755 (executable)
@@ -211,14 +211,14 @@ public interface SequenceI
      *\r
      * @return DOCUMENT ME!\r
      */\r
-    public Vector getSequenceFeatures();\r
+    public SequenceFeature[] getSequenceFeatures();\r
 \r
     /**\r
      * DOCUMENT ME!\r
      *\r
      * @param v DOCUMENT ME!\r
      */\r
-    public void setSequenceFeatures(Vector v);\r
+    public void setSequenceFeatures(SequenceFeature [] features);\r
 \r
     /**\r
      * DOCUMENT ME!\r