From 6b88cfe942593f7ab1c5c90b99aa3a3e315c94bc Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 31 Aug 2017 07:04:43 +0100 Subject: [PATCH] JAL-2694 utility to transform single String to List[1] --- src/jalview/structure/StructureSelectionManager.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; + } + } -- 1.7.10.2