From: jprocter Date: Fri, 28 Oct 2011 14:06:02 +0000 (+0100) Subject: JAL-580 ensure WUSS annotation is reparsed if necessary and cope with parse errors X-Git-Tag: Jalview_2_9~565^2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=857a40730ad5db87bfc7a381924717a2162c2b81;p=jalview.git JAL-580 ensure WUSS annotation is reparsed if necessary and cope with parse errors --- diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 66bccb9..ca3c6d5 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -44,6 +44,7 @@ public class Rna * pair, end is close base pair */ public static SequenceFeature[] GetBasePairs(String line) + public static SequenceFeature[] GetBasePairs(CharSequence line) throws WUSSParseException { Vector stack = new Vector(); diff --git a/src/jalview/analysis/WUSSParseException.java b/src/jalview/analysis/WUSSParseException.java new file mode 100644 index 0000000..c8ade0c --- /dev/null +++ b/src/jalview/analysis/WUSSParseException.java @@ -0,0 +1,19 @@ +package jalview.analysis; + +public class WUSSParseException extends Exception { + private long problemPos; + public WUSSParseException(long problemPos) + { + this("Invalid WUSS Notation", problemPos); + } + public WUSSParseException(String message, long problemPos) + { + super(message+" at or near position "+problemPos); + this.problemPos=problemPos; + } + public long getProblemPos() + { + return problemPos; + } + +} \ No newline at end of file