From: Jim Procter Date: Thu, 31 Aug 2017 06:04:43 +0000 (+0100) Subject: JAL-2694 utility to transform single String to List[1] X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6b88cfe942593f7ab1c5c90b99aa3a3e315c94bc;p=jalview.git JAL-2694 utility to transform single String to List[1] --- diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 9020ed4..a98738f 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -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[] perChainList(String[] chains) + { + List[] chainsL = new List[chains.length]; + int p = 0; + for (String ch : chains) + { + chainsL[p] = new ArrayList(); + chainsL[p++].add(ch); + } + return chainsL; + } + }