Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Dez 29 2005 18:38:29 CET
file stats: LOC: 114   Methods: 12
NCLOC: 58   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AxiomVo.java 100% 84,2% 75% 83,8%
coverage coverage
 1    /* $Id: AxiomVo.java,v 1.6 2005/12/09 18:23:55 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2005, 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.dto.module;
 19   
 20    import org.qedeq.kernel.base.module.Axiom;
 21    import org.qedeq.kernel.base.module.Definition;
 22    import org.qedeq.kernel.base.module.FormulaOrTerm;
 23    import org.qedeq.kernel.base.module.LatexList;
 24    import org.qedeq.kernel.base.module.Proposition;
 25    import org.qedeq.kernel.base.module.Rule;
 26    import org.qedeq.kernel.utility.EqualsUtility;
 27   
 28   
 29    /**
 30    * Axiom.
 31    *
 32    * @version $Revision: 1.6 $
 33    * @author Michael Meyling
 34    */
 35    public final class AxiomVo implements Axiom {
 36   
 37    /** Axiom formula. */
 38    private FormulaOrTerm formula;
 39   
 40    /** Further proposition description. Normally <code>null</code>. */
 41    private LatexList description;
 42   
 43    /**
 44    * Constructs a new axiom.
 45    */
 46  52 public AxiomVo() {
 47    // nothing to do
 48    }
 49   
 50  6 public Axiom getAxiom() {
 51  6 return this;
 52    }
 53   
 54  0 public Definition getDefinition() {
 55  0 return null;
 56    }
 57   
 58  0 public Proposition getProposition() {
 59  0 return null;
 60    }
 61   
 62  0 public Rule getRule() {
 63  0 return null;
 64    }
 65   
 66    /**
 67    * Set axiom formula.
 68    *
 69    * @param formula Set axiom formula.
 70    */
 71  31 public final void setFormula(final FormulaOrTerm formula) {
 72  31 this.formula = formula;
 73    }
 74   
 75  175 public final FormulaOrTerm getFormula() {
 76  175 return formula;
 77    }
 78   
 79    /**
 80    * Set description. Only necessary if formula is not self-explanatory.
 81    *
 82    * @param description Description.
 83    */
 84  16 public final void setDescription(final LatexList description) {
 85  16 this.description = description;
 86    }
 87   
 88  144 public LatexList getDescription() {
 89  144 return description;
 90    }
 91   
 92  33 public boolean equals(final Object obj) {
 93  33 if (!(obj instanceof AxiomVo)) {
 94  4 return false;
 95    }
 96  29 final AxiomVo other = (AxiomVo) obj;
 97  29 return EqualsUtility.equals(getFormula(), other.getFormula())
 98    && EqualsUtility.equals(getDescription(), other.getDescription());
 99    }
 100   
 101  42 public int hashCode() {
 102  42 return (getFormula() != null ? getFormula().hashCode() : 0)
 103  42 ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0);
 104    }
 105   
 106  32 public String toString() {
 107  32 final StringBuffer buffer = new StringBuffer();
 108  32 buffer.append("Axiom:\n");
 109  32 buffer.append(getFormula());
 110  32 buffer.append("\nDescription:\n");
 111  32 buffer.append(getDescription());
 112  32 return buffer.toString();
 113    }
 114    }