Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart8.png 47% of files have more coverage
20   119   14   1,54
6   62   0,7   13
13     1,08  
1    
 
  AxiomVo       Line # 36 20 14 79,5% 0.7948718
 
  (26)
 
1    /* $Id: AxiomVo.java,v 1.12 2008/07/26 07:59:35 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, 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.base.utility.EqualsUtility;
21    import org.qedeq.kernel.base.module.Axiom;
22    import org.qedeq.kernel.base.module.Formula;
23    import org.qedeq.kernel.base.module.FunctionDefinition;
24    import org.qedeq.kernel.base.module.LatexList;
25    import org.qedeq.kernel.base.module.PredicateDefinition;
26    import org.qedeq.kernel.base.module.Proposition;
27    import org.qedeq.kernel.base.module.Rule;
28   
29   
30    /**
31    * Axiom.
32    *
33    * @version $Revision: 1.12 $
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  442 toggle public AxiomVo() {
48    // nothing to do
49    }
50   
 
51  2348 toggle public Axiom getAxiom() {
52  2348 return this;
53    }
54   
 
55  0 toggle public PredicateDefinition getPredicateDefinition() {
56  0 return null;
57    }
58   
 
59  0 toggle public FunctionDefinition getFunctionDefinition() {
60  0 return null;
61    }
62   
 
63  0 toggle public Proposition getProposition() {
64  0 return null;
65    }
66   
 
67  0 toggle public Rule getRule() {
68  0 return null;
69    }
70   
71    /**
72    * Set axiom formula.
73    *
74    * @param formula Set axiom formula.
75    */
 
76  419 toggle public final void setFormula(final FormulaVo formula) {
77  419 this.formula = formula;
78    }
79   
 
80  9029 toggle public final Formula getFormula() {
81  9029 return formula;
82    }
83   
84    /**
85    * Set description. Only necessary if formula is not self-explanatory.
86    *
87    * @param description Description.
88    */
 
89  16 toggle public final void setDescription(final LatexListVo description) {
90  16 this.description = description;
91    }
92   
 
93  1107 toggle public LatexList getDescription() {
94  1107 return description;
95    }
96   
 
97  33 toggle 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 toggle public int hashCode() {
107  44 return (getFormula() != null ? getFormula().hashCode() : 0)
108  44 ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0);
109    }
110   
 
111  34 toggle 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    }