Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../../img/srcFileCovDistChart3.png 88% of files have more coverage
6   90   4   1.5
0   23   0.67   4
4     1  
1    
 
  LogicalCheckException       Line # 27 6 4 30% 0.3
 
  (12)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.bo.logic.wf;
17   
18    import org.qedeq.kernel.base.list.Element;
19    import org.qedeq.kernel.common.ModuleContext;
20    import org.qedeq.kernel.common.ModuleDataException;
21   
22    /**
23    * This is the basis for an exception for logical errors within a QEDEQ module.
24    *
25    * @author Michael Meyling
26    */
 
27    public abstract class LogicalCheckException extends ModuleDataException {
28   
29    /**
30    * This element causes the error.
31    */
32    private final Element element;
33   
34    /**
35    * Constructs an exception.
36    *
37    * @param errorCode ErrorCode of this message.
38    * @param message What is the problem.
39    * @param element Problematic line.
40    * @param context Error location.
41    * @param referenceContext Reference location.
42    */
 
43  0 toggle public LogicalCheckException(final int errorCode, final String message, final Element element,
44    final ModuleContext context, final ModuleContext referenceContext) {
45  0 super(errorCode, message, context, referenceContext);
46  0 this.element = element;
47    }
48   
49    /**
50    * Constructs an exception.
51    *
52    * @param errorCode ErrorCode of this message.
53    * @param message What is the problem.
54    * @param element Problematic formula.
55    * @param context Error location.
56    */
 
57  132 toggle public LogicalCheckException(final int errorCode, final String message,
58    final Element element, final ModuleContext context) {
59  132 super(errorCode, message, context);
60  132 this.element = element;
61    }
62   
63    /**
64    * Get the element.
65    *
66    * @return element, that should have been a symbol
67    */
 
68  0 toggle public final Element getElement() {
69  0 return this.element;
70    }
71   
72    /**
73    * Returns a short description of this throwable.
74    * If this <code>Throwable</code> object was created with a non-null detail
75    * message string, then the result is the concatenation of five strings:
76    * <ul>
77    * <li>The name of the actual class of this object
78    * <li>": " (a colon and a space)
79    * <li>The result of the {@link Throwable#getMessage()} method for this object
80    * <li>"\n" (a newline)
81    * <li>A string representation of the {@link #getElement()} method for this object
82    * </ul>
83    *
84    * @return a string representation of this throwable.
85    */
 
86  0 toggle public final String toString() {
87  0 return super.toString() + "\n" + getElement().toString();
88    }
89   
90    }