Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../img/srcFileCovDistChart8.png 50% of files have more coverage
20   117   14   1.54
6   62   0.7   13
13     1.08  
1    
 
  AxiomVo       Line # 34 20 14 79.5% 0.7948718
 
  (38)
 
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.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.base.module.Axiom;
20    import org.qedeq.kernel.base.module.Formula;
21    import org.qedeq.kernel.base.module.FunctionDefinition;
22    import org.qedeq.kernel.base.module.LatexList;
23    import org.qedeq.kernel.base.module.PredicateDefinition;
24    import org.qedeq.kernel.base.module.Proposition;
25    import org.qedeq.kernel.base.module.Rule;
26   
27   
28    /**
29    * Axiom.
30    *
31    * @version $Revision: 1.12 $
32    * @author Michael Meyling
33    */
 
34    public class AxiomVo implements Axiom {
35   
36    /** Axiom formula. */
37    private Formula formula;
38   
39    /** Further proposition description. Normally <code>null</code>. */
40    private LatexList description;
41   
42    /**
43    * Constructs a new axiom.
44    */
 
45  545 toggle public AxiomVo() {
46    // nothing to do
47    }
48   
 
49  2498 toggle public Axiom getAxiom() {
50  2498 return this;
51    }
52   
 
53  0 toggle public PredicateDefinition getPredicateDefinition() {
54  0 return null;
55    }
56   
 
57  0 toggle public FunctionDefinition getFunctionDefinition() {
58  0 return null;
59    }
60   
 
61  0 toggle public Proposition getProposition() {
62  0 return null;
63    }
64   
 
65  0 toggle public Rule getRule() {
66  0 return null;
67    }
68   
69    /**
70    * Set axiom formula.
71    *
72    * @param formula Set axiom formula.
73    */
 
74  522 toggle public final void setFormula(final FormulaVo formula) {
75  522 this.formula = formula;
76    }
77   
 
78  10431 toggle public final Formula getFormula() {
79  10431 return formula;
80    }
81   
82    /**
83    * Set description. Only necessary if formula is not self-explanatory.
84    *
85    * @param description Description.
86    */
 
87  16 toggle public final void setDescription(final LatexListVo description) {
88  16 this.description = description;
89    }
90   
 
91  1517 toggle public LatexList getDescription() {
92  1517 return description;
93    }
94   
 
95  33 toggle public boolean equals(final Object obj) {
96  33 if (!(obj instanceof AxiomVo)) {
97  4 return false;
98    }
99  29 final AxiomVo other = (AxiomVo) obj;
100  29 return EqualsUtility.equals(getFormula(), other.getFormula())
101    && EqualsUtility.equals(getDescription(), other.getDescription());
102    }
103   
 
104  44 toggle public int hashCode() {
105  44 return (getFormula() != null ? getFormula().hashCode() : 0)
106  44 ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0);
107    }
108   
 
109  34 toggle public String toString() {
110  34 final StringBuffer buffer = new StringBuffer();
111  34 buffer.append("Axiom:\n");
112  34 buffer.append(getFormula());
113  34 buffer.append("\nDescription:\n");
114  34 buffer.append(getDescription());
115  34 return buffer.toString();
116    }
117    }