01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.proof;
12:
13: /**
14: * Represents an exception with position information. The row position is
15: * absolut this means, if in a table it is the row of the table, but the column
16: * position is relative to the text and does not describe the column of the
17: * table. (has to be changed)
18: */
19: public abstract class SVInstantiationExceptionWithPosition extends
20: SVInstantiationException {
21:
22: private int row;
23: private int column;
24: private boolean inIfSequent;
25:
26: public SVInstantiationExceptionWithPosition(String description,
27: int row, int column, boolean inIfSequent) {
28: super (description);
29: this .row = row;
30: this .column = column;
31: this .inIfSequent = inIfSequent;
32:
33: }
34:
35: public boolean inIfSequent() {
36: return inIfSequent;
37: }
38:
39: public int getRow() {
40: return row;
41: }
42:
43: public int getColumn() {
44: return column;
45: }
46:
47: public String getMessage() {
48: String errmsg = super .getMessage() + ":";
49: if (inIfSequent()) {
50: errmsg += row <= 0 ? "" : ("\nAssumption number:" + row);
51: } else {
52: errmsg += row <= 0 ? "" : ("\nRow: " + getRow());
53: errmsg += column <= 0 ? "" : ("\nColumn: " + getColumn());
54: }
55: return errmsg;
56: }
57:
58: /**
59: * Returns a string representation of this exception.
60: */
61: public String toString() {
62: return getMessage();
63: }
64: }
|