From: TZVanaalten Date: Thu, 17 Aug 2017 13:53:47 +0000 (+0100) Subject: JAL-2599 move fillSymbol method to HMFile X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b01df27fdea3841c660c78a94bc89fde18113bab;p=jalview.git JAL-2599 move fillSymbol method to HMFile --- 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++; + } + } }