Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
27   149   22   1.59
10   83   0.81   17
17     1.29  
1    
 
  AxiomVo       Line # 35 27 22 100% 1.0
 
  (77)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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.se.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.se.base.module.Axiom;
20    import org.qedeq.kernel.se.base.module.Formula;
21    import org.qedeq.kernel.se.base.module.FunctionDefinition;
22    import org.qedeq.kernel.se.base.module.InitialFunctionDefinition;
23    import org.qedeq.kernel.se.base.module.InitialPredicateDefinition;
24    import org.qedeq.kernel.se.base.module.LatexList;
25    import org.qedeq.kernel.se.base.module.PredicateDefinition;
26    import org.qedeq.kernel.se.base.module.Proposition;
27    import org.qedeq.kernel.se.base.module.Rule;
28   
29   
30    /**
31    * Axiom.
32    *
33    * @author Michael Meyling
34    */
 
35    public class AxiomVo implements Axiom {
36   
37    /** Axiom formula. */
38    private Formula formula;
39   
40    /** Further proposition description. Normally <code>null</code>. */
41    private LatexList description;
42   
43    /** Defined operator. The axiom defines this operator. Normally <code>null</code>.*/
44    private String definedOperator;
45   
46    /**
47    * Constructs a new axiom.
48    */
 
49  6962 toggle public AxiomVo() {
50    // nothing to do
51    }
52   
 
53  13790 toggle public Axiom getAxiom() {
54  13790 return this;
55    }
56   
 
57  1 toggle public InitialPredicateDefinition getInitialPredicateDefinition() {
58  1 return null;
59    }
60   
 
61  438 toggle public PredicateDefinition getPredicateDefinition() {
62  438 return null;
63    }
64   
 
65  1 toggle public InitialFunctionDefinition getInitialFunctionDefinition() {
66  1 return null;
67    }
68   
 
69  438 toggle public FunctionDefinition getFunctionDefinition() {
70  438 return null;
71    }
72   
 
73  450 toggle public Proposition getProposition() {
74  450 return null;
75    }
76   
 
77  1 toggle public Rule getRule() {
78  1 return null;
79    }
80   
81    /**
82    * Set axiom formula.
83    *
84    * @param formula Set axiom formula.
85    */
 
86  6925 toggle public final void setFormula(final FormulaVo formula) {
87  6925 this.formula = formula;
88    }
89   
 
90  47216 toggle public final Formula getFormula() {
91  47216 return formula;
92    }
93   
94    /**
95    * Set description. Only necessary if formula is not self-explanatory.
96    *
97    * @param description Description.
98    */
 
99  18 toggle public final void setDescription(final LatexListVo description) {
100  18 this.description = description;
101    }
102   
 
103  12289 toggle public LatexList getDescription() {
104  12289 return description;
105    }
106   
 
107  4034 toggle public String getDefinedOperator() {
108  4034 return definedOperator;
109    }
110   
111    /**
112    * Set operator which is defined by this axiom. So the axiom can be eliminated by eliminating
113    * this operator.
114    *
115    * @param definedOperator This operator is defined by this axiom.
116    */
 
117  3712 toggle public void setDefinedOperator(final String definedOperator) {
118  3712 this.definedOperator = definedOperator;
119    }
120   
 
121  46 toggle public boolean equals(final Object obj) {
122  46 if (!(obj instanceof AxiomVo)) {
123  5 return false;
124    }
125  41 final AxiomVo other = (AxiomVo) obj;
126  41 return EqualsUtility.equals(getFormula(), other.getFormula())
127    && EqualsUtility.equals(getDescription(), other.getDescription())
128    && EqualsUtility.equals(getDefinedOperator(), other.getDefinedOperator());
129    }
130   
 
131  60 toggle public int hashCode() {
132  60 return (getFormula() != null ? getFormula().hashCode() : 0)
133  60 ^ (getDefinedOperator() != null ? 1 ^ getDefinedOperator().hashCode() : 0)
134  60 ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0);
135    }
136   
 
137  44 toggle public String toString() {
138  44 final StringBuffer buffer = new StringBuffer();
139  44 buffer.append("Axiom");
140  44 if (definedOperator != null) {
141  18 buffer.append(" (defines: " + definedOperator);
142    }
143  44 buffer.append(":\n");
144  44 buffer.append(getFormula());
145  44 buffer.append("\nDescription:\n");
146  44 buffer.append(getDescription());
147  44 return buffer.toString();
148    }
149    }