has ref to annotation
[jalview.git] / src / jalview / datamodel / Sequence.java
index 65537ae..d35a05b 100755 (executable)
@@ -42,6 +42,9 @@ public class Sequence implements SequenceI
     String vamsasId;\r
     Vector dbrefs;\r
 \r
+    /** This annotation is displayed below the alignment but the\r
+     * positions are tied to the residues of this sequence */\r
+    Vector annotation;\r
 \r
     /** DOCUMENT ME!! */\r
     public Vector sequenceFeatures;\r
@@ -574,4 +577,24 @@ public class Sequence implements SequenceI
       return datasetSequence;\r
     }\r
 \r
+    public AlignmentAnnotation [] getAnnotation()\r
+    {\r
+      if(annotation==null)\r
+        return null;\r
+\r
+      AlignmentAnnotation [] ret = new AlignmentAnnotation[annotation.size()];\r
+      for(int r = 0; r<ret.length; r++)\r
+        ret[r] = (AlignmentAnnotation)annotation.elementAt(r);\r
+\r
+      return ret;\r
+    }\r
+\r
+    public void addAlignmentAnnotation(AlignmentAnnotation annotation)\r
+    {\r
+      if(this.annotation==null)\r
+        this.annotation = new Vector();\r
+\r
+      this.annotation.addElement( annotation );\r
+    }\r
+\r
 }\r