JAL-2694 utility to transform single String to List<String>[1]
authorJim Procter <jprocter@issues.jalview.org>
Thu, 31 Aug 2017 06:04:43 +0000 (07:04 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 31 Aug 2017 06:04:43 +0000 (07:04 +0100)
src/jalview/structure/StructureSelectionManager.java

index 9020ed4..a98738f 100644 (file)
@@ -1420,4 +1420,22 @@ public class StructureSelectionManager
     return seqmappings;
   }
 
+  /**
+   * utilty method - transform array of chain characters
+   * 
+   * @param chains
+   * @return array of lists with a chain in each
+   */
+  public static List<String>[] perChainList(String[] chains)
+  {
+    List<String>[] chainsL = new List[chains.length];
+    int p = 0;
+    for (String ch : chains)
+    {
+      chainsL[p] = new ArrayList();
+      chainsL[p++].add(ch);
+    }
+    return chainsL;
+  }
+
 }