header updated
[jalview.git] / src / jalview / datamodel / SequenceFeature.java
index b054ea1..ca72942 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer\r
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2006 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
@@ -33,8 +33,7 @@ public class SequenceFeature
     public float score;\r
     public String type;\r
     public String description;\r
-    public String status;\r
-    Hashtable otherDetails;\r
+    public Hashtable otherDetails;\r
     public java.util.Vector links;\r
 \r
     // Feature group can be set from a features file\r
@@ -52,11 +51,12 @@ public class SequenceFeature
     {\r
       this.type = type;\r
       this.description = desc;\r
-      this.status = status;\r
+      setValue("status", status);\r
       this.begin = begin;\r
       this.end = end;\r
       this.featureGroup = featureGroup;\r
     }\r
+\r
     public SequenceFeature(String type,\r
                            String desc,\r
                            int begin, int end,\r
@@ -65,7 +65,6 @@ public class SequenceFeature
     {\r
       this.type = type;\r
       this.description = desc;\r
-      this.status = status;\r
       this.begin = begin;\r
       this.end = end;\r
       this.score = score;\r
@@ -74,13 +73,13 @@ public class SequenceFeature
 \r
     public boolean equals(SequenceFeature sf)\r
     {\r
-      if(begin != sf.begin\r
-      || end != sf.end)\r
-     return false;\r
-\r
+      if (begin != sf.begin\r
+          || end != sf.end\r
+          || score != sf.score)\r
+        return false;\r
 \r
-      if(!(type+description+status).equals\r
-         (sf.type+sf.description+sf.status))\r
+      if(!(type+description+featureGroup).equals\r
+         (sf.type+sf.description+sf.featureGroup))\r
         return false;\r
 \r
       return true;\r
@@ -147,21 +146,6 @@ public class SequenceFeature
       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
-    public void setStatus(String status)\r
-    {\r
-      this.status = status;\r
-    }\r
-\r
     public String getFeatureGroup()\r
     {\r
       return featureGroup;\r
@@ -211,11 +195,42 @@ public class SequenceFeature
      */\r
     public void setValue(String key, Object value)\r
     {\r
-      if(otherDetails == null)\r
-        otherDetails = new Hashtable();\r
+      if(value!=null)\r
+      {\r
+        if (otherDetails == null)\r
+          otherDetails = new Hashtable();\r
 \r
-      otherDetails.put(key, value);\r
+        otherDetails.put(key, value);\r
+      }\r
     }\r
 \r
 \r
+    /*\r
+     * The following methods are added to maintain\r
+     * the castor Uniprot mapping file for the moment.\r
+     */\r
+    public void setStatus(String status)\r
+    {\r
+      setValue("status", status);\r
+    }\r
+\r
+    public String getStatus()\r
+    {\r
+      if (otherDetails != null)\r
+        return otherDetails.get("status").toString();\r
+      else\r
+        return null;\r
+    }\r
+\r
+    public void setPosition(int pos)\r
+    {\r
+      begin = pos;\r
+      end = pos;\r
+    }\r
+\r
+    public int getPosition()\r
+    {\r
+      return begin;\r
+    }\r
+\r
 }\r