JAL-3829 look up column in FTS data
authorJim Procter <j.procter@dundee.ac.uk>
Mon, 6 Sep 2021 13:47:41 +0000 (14:47 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Mon, 6 Sep 2021 13:47:41 +0000 (14:47 +0100)
src/jalview/fts/core/FTSRestRequest.java

index 2d9eeb6..bf88d2d 100644 (file)
@@ -188,4 +188,23 @@ public class FTSRestRequest
   {
     this.offSet = offSet;
   }
+
+  /**
+   * locate column given field name
+   * @param string - field name
+   * @return -1 if not located
+   */
+  public int getFieldIndex(String string)
+  {
+    int i=associatedSequence!=null ? 1 : 0;
+    for (FTSDataColumnI field:wantedFields)
+    {
+      if (field.getName().equals(string))
+      {
+        return i; 
+      }
+      i++;
+    }
+    return -1;
+  }
 }