FeaturesGroup added to constructor
[jalview.git] / src / jalview / datamodel / SequenceFeature.java
index f7d8d89..f8444a0 100755 (executable)
 /*\r
-* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
-*\r
-* This program is free software; you can redistribute it and/or\r
-* modify it under the terms of the GNU General Public License\r
-* as published by the Free Software Foundation; either version 2\r
-* of the License, or (at your option) any later version.\r
-*\r
-* This program is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-* GNU General Public License for more details.\r
-*\r
-* You should have received a copy of the GNU General Public License\r
-* along with this program; if not, write to the Free Software\r
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
-*/\r
+ * Jalview - A Sequence Alignment Editor and Viewer\r
+ * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
+ */\r
 package jalview.datamodel;\r
 \r
-import java.awt.*;\r
+/**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @author $author$\r
+ * @version $Revision$\r
+ */\r
+public class SequenceFeature\r
+{\r
+    public int position;\r
+    public int begin;\r
+    public int end;\r
+    public String type;\r
+    public String description;\r
+    public String status;\r
 \r
+    // Feature group can be set from a features file\r
+    // as a group of features between STARTGROUP and ENDGROUP markers\r
+    public String featureGroup;\r
 \r
-public class SequenceFeature {\r
-    int begin;\r
-    int end;\r
-    String type;\r
-    String description;\r
-    String status;\r
+    public SequenceFeature()\r
+    {}\r
 \r
-    public SequenceFeature() {\r
+    public SequenceFeature(String type,\r
+                           String desc,\r
+                           String status,\r
+                           int begin, int end,\r
+                           String featureGroup)\r
+    {\r
+      this.type = type;\r
+      this.description = desc;\r
+      this.status = status;\r
+      this.position = begin;\r
+      this.begin = begin;\r
+      this.end = end;\r
+      this.featureGroup = featureGroup;\r
     }\r
 \r
-    public SequenceFeature(String type, int start, int end, String description,\r
-        String status) {\r
-        this.type = type;\r
-        this.begin = start;\r
-        this.end = end;\r
-        this.description = description;\r
-        this.status = status;\r
+    public boolean equals(SequenceFeature sf)\r
+    {\r
+      if(begin != sf.begin\r
+      || end != sf.end)\r
+     return false;\r
+\r
+\r
+      if(!(type+description+status).equals\r
+         (sf.type+sf.description+sf.status))\r
+        return false;\r
+\r
+      return true;\r
+    }\r
+\r
+\r
+    public int getPosition()\r
+    {\r
+      return position;\r
     }\r
 \r
-    public int getStart() {\r
+    public void setPosition(int pos)\r
+    {\r
+      position = pos;\r
+      begin = pos;\r
+      end = pos;\r
+    }\r
+\r
+\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public int getBegin()\r
+    {\r
         return begin;\r
     }\r
 \r
-    public int getEnd() {\r
+    public void setBegin(int start)\r
+    {\r
+      this.begin = start;\r
+    }\r
+\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public int getEnd()\r
+    {\r
         return end;\r
     }\r
 \r
-    public String getType() {\r
+    public void setEnd(int end)\r
+    {\r
+      this.end = end;\r
+    }\r
+\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String getType()\r
+    {\r
         return type;\r
     }\r
 \r
-    public String getDescription() {\r
+    public void setType(String type)\r
+    {\r
+      this.type = type;\r
+    }\r
+\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String getDescription()\r
+    {\r
         return description;\r
     }\r
 \r
-    public String getStatus() {\r
+    public void setDescription(String desc)\r
+    {\r
+      description = desc;\r
+    }\r
+\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String getStatus()\r
+    {\r
         return status;\r
     }\r
 \r
-    /*\r
-          <xs:enumeration value="active site" />\r
-    <xs:enumeration value="binding site" />\r
-    <xs:enumeration value="calcium-binding region" />\r
-    <xs:enumeration value="chain" />\r
-    <xs:enumeration value="cross-link" />\r
-    <xs:enumeration value="disulfide bond" />\r
-    <xs:enumeration value="DNA-binding region" />\r
-    <xs:enumeration value="domain" />\r
-    <xs:enumeration value="glycosylation site" />\r
-    <xs:enumeration value="helix" />\r
-    <xs:enumeration value="initiator methionine" />\r
-    <xs:enumeration value="lipid moiety-binding region" />\r
-    <xs:enumeration value="metal ion-binding site" />\r
-    <xs:enumeration value="modified residue" />\r
-    <xs:enumeration value="mutagenesis site" />\r
-    <xs:enumeration value="non-consecutive residues" />\r
-    <xs:enumeration value="non-terminal residue" />\r
-    <xs:enumeration value="nucleotide phosphate-binding region" />\r
-    <xs:enumeration value="peptide" />\r
-    <xs:enumeration value="propeptide" />\r
-    <xs:enumeration value="repeat" />\r
-    <xs:enumeration value="selenocysteine" />\r
-    <xs:enumeration value="sequence conflict" />\r
-    <xs:enumeration value="sequence variant" />\r
-    <xs:enumeration value="signal peptide" />\r
-    <xs:enumeration value="similar" />\r
-    <xs:enumeration value="site" />\r
-    <xs:enumeration value="splice variant" />\r
-    <xs:enumeration value="strand" />\r
-    <xs:enumeration value="thioether bond" />\r
-    <xs:enumeration value="thiolester bond" />\r
-    <xs:enumeration value="transit peptide" />\r
-    <xs:enumeration value="transmembrane region" />\r
-    <xs:enumeration value="turn" />\r
-    <xs:enumeration value="unsure residue" />\r
-    <xs:enumeration value="zinc finger region" />\r
-    */\r
+    public void setStatus(String status)\r
+    {\r
+      this.status = status;\r
+    }\r
+\r
+    public String getFeatureGroup()\r
+    {\r
+      return featureGroup;\r
+    }\r
+\r
+    public void setFeatureGroup(String featureGroup)\r
+    {\r
+      this.featureGroup = featureGroup;\r
+    }\r
+\r
+\r
 }\r