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