From b01df27fdea3841c660c78a94bc89fde18113bab Mon Sep 17 00:00:00 2001 From: TZVanaalten Date: Thu, 17 Aug 2017 14:53:47 +0100 Subject: [PATCH] JAL-2599 move fillSymbol method to HMFile --- src/jalview/io/HMMFile.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/jalview/io/HMMFile.java b/src/jalview/io/HMMFile.java index 28aa62f..b2a6f8b 100644 --- a/src/jalview/io/HMMFile.java +++ b/src/jalview/io/HMMFile.java @@ -154,7 +154,7 @@ public class HMMFile extends AlignFile // properties) { readingFile = false; - hmm.fillSymbols(parser); + fillSymbols(parser); numberOfSymbols = hmm.getNumberOfSymbols(); } else if ("STATS".equals(next)) @@ -729,5 +729,23 @@ public class HMMFile extends AlignFile } + /** + * Fills symbol array and adds each symbol to an index lookup + * + * @param parser + * The scanner scanning the symbol line in the file. + */ + public void fillSymbols(Scanner parser) + { + int i = 0; + while (parser.hasNext()) + { + String strSymbol = parser.next(); + char[] symbol = strSymbol.toCharArray(); + hmm.getSymbols().add(symbol[0]); + hmm.setSymbolIndex(symbol[0], i); + i++; + } + } } -- 1.7.10.2