From e30d3b21a84142963e5f217125d6930589910343 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 25 Jun 2019 20:16:13 -0400 Subject: Update site --- docs/jacoco-ut/bjc.everge/ReplError.java.html | 87 +++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 docs/jacoco-ut/bjc.everge/ReplError.java.html (limited to 'docs/jacoco-ut/bjc.everge/ReplError.java.html') diff --git a/docs/jacoco-ut/bjc.everge/ReplError.java.html b/docs/jacoco-ut/bjc.everge/ReplError.java.html new file mode 100644 index 0000000..e2d44dc --- /dev/null +++ b/docs/jacoco-ut/bjc.everge/ReplError.java.html @@ -0,0 +1,87 @@ +ReplError.java

ReplError.java

package bjc.everge;
+
+/**
+ * Represents an error encountered parsing ReplPairs
+ *
+ * @author Ben Culkin
+ */
+public class ReplError {
+	/**
+	 * The line the error occured on.
+	 */
+	public int line;
+	/**
+	 * The number of pairs we have processed so far.
+	 */
+	public int numPairs;
+
+	/**
+	 * The text of the line we errored on.
+	 */
+	public String txt;
+	/**
+	 * The message of the error.
+	 */
+	public String msg;
+
+	/**
+	 * Create a new ReplPair parse error.
+	 *
+	 * @param lne
+	 * 	The line the error occured on.
+	 * @param nPairs
+	 * 	The number of pairs processed up to this point.
+	 * @param msg
+	 * 	The message detailing the error.
+	 * @param txt
+	 * 	The text that caused the error.
+	 */
+	public ReplError(IntHolder lne, IntHolder nPairs, String msg, String txt) {
+		this(lne.get(), nPairs.get(), msg, txt);
+	}
+
+	/**
+	 * Create a new ReplPair parse error.
+	 *
+	 * @param lne
+	 * 	The line the error occured on.
+	 * @param nPairs
+	 * 	The number of pairs processed up to this point.
+	 * @param msg
+	 * 	The message detailing the error.
+	 * @param txt
+	 * 	The text that caused the error.
+	 */
+	public ReplError(int lne, int nPairs, String msg, String txt) {
+		line = lne;
+		numPairs = nPairs;
+
+		this.txt = txt;
+		this.msg = msg;
+	}
+
+	@Override
+	public String toString() {
+		String errString;
+		if      (txt == null)    errString = "No associated line";
+		else if (txt.equals("")) errString = "Text of line was empty";
+		else                     errString = "Text of line was: " + txt;
+
+		return String.format("line %d, pair %d:%s\n\t%s", line, numPairs, msg, errString);
+	}
+
+	public String toPrintString() {
+		return toPrintString("");
+	}
+
+	public String toPrintString(String hdr) {
+		String errString;
+		if      (txt == null)    errString = "No associated line";
+		else if (txt.equals("")) errString = "Text of line was empty";
+		else                     errString = "Text of line was: " + txt;
+
+		return String.format("[ERROR] line %d, pair %d: %s\n%s\tContext: %s",
+				line, numPairs, msg, hdr, errString);
+	}
+}
+
\ No newline at end of file -- cgit v1.2.3