JAL-653 convenience method to resolve strand attribute for feature
[jalview.git] / src / jalview / datamodel / SequenceFeature.java
index 28ab82c..1b6498f 100755 (executable)
@@ -302,4 +302,23 @@ public class SequenceFeature
     return begin;
   }
 
+  public int getStrand()
+  {
+    String str;
+    if (otherDetails == null
+            || (str = otherDetails.get("STRAND").toString()) == null)
+    {
+      return 0;
+    }
+    if (str.equals("-"))
+    {
+      return -1;
+    }
+    if (str.equals("+"))
+    {
+      return 1;
+    }
+    return 0;
+  }
+
 }