From: Jim Procter Date: Mon, 7 May 2018 16:36:28 +0000 (+0100) Subject: JAL-2321 isParseImmediately() allows the parse() method to determine if it was called... X-Git-Tag: Release_2_10_4~7^2~5 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=0669bcd76c254141146c1fc2628812c782571c0b JAL-2321 isParseImmediately() allows the parse() method to determine if it was called by the constructor or after construction --- diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 2340283..7b1e84a 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -72,8 +72,21 @@ public abstract class AlignFile extends FileParse long end; + /** + * true if parse() has been called + */ private boolean parseCalled; + private boolean parseImmediately; + + /** + * @return if doParse() was called at construction time + */ + protected boolean isParseImmediately() + { + return parseImmediately; + } + /** * Creates a new AlignFile object. */ @@ -153,6 +166,11 @@ public abstract class AlignFile extends FileParse { super(source); initData(); + + // stash flag in case parse needs to know if it has to autoconfigure or was + // configured after construction + this.parseImmediately = parseImmediately; + if (parseImmediately) { doParse();