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