Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart9.png 30% of files have more coverage
27   153   18   1,69
10   80   0,67   16
16     1,12  
1    
 
  PropositionVo       Line # 37 27 18 84,9% 0.8490566
 
  (21)
 
1    /* $Id: PropositionVo.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.ProofList;
27    import org.qedeq.kernel.base.module.Proposition;
28    import org.qedeq.kernel.base.module.Rule;
29   
30   
31    /**
32    * Proposition.
33    *
34    * @version $Revision: 1.12 $
35    * @author Michael Meyling
36    */
 
37    public class PropositionVo implements Proposition {
38   
39    /** Proposition formula. */
40    private Formula formula;
41   
42    /** Further proposition description. Normally <code>null</code>. */
43    private LatexList description;
44   
45    /** List of proofs. */
46    private ProofListVo proofList;
47   
48    /**
49    * Constructs a new proposition.
50    */
 
51  1006 toggle public PropositionVo() {
52    // nothing to do
53    }
54   
 
55  0 toggle public Axiom getAxiom() {
56  0 return null;
57    }
58   
 
59  0 toggle public PredicateDefinition getPredicateDefinition() {
60  0 return null;
61    }
62   
 
63  0 toggle public FunctionDefinition getFunctionDefinition() {
64  0 return null;
65    }
66   
 
67  18331 toggle public Proposition getProposition() {
68  18331 return this;
69    }
70   
 
71  0 toggle public Rule getRule() {
72  0 return null;
73    }
74   
75    /**
76    * Set proposition formula.
77    *
78    * @param formula Proposition formula.
79    */
 
80  976 toggle public final void setFormula(final FormulaVo formula) {
81  976 this.formula = formula;
82    }
83   
 
84  58639 toggle public final Formula getFormula() {
85  58639 return formula;
86    }
87   
88    /**
89    * Set description. Only necessary if formula is not self-explanatory.
90    *
91    * @param description Description.
92    */
 
93  31 toggle public final void setDescription(final LatexListVo description) {
94  31 this.description = description;
95    }
96   
 
97  2792 toggle public LatexList getDescription() {
98  2792 return description;
99    }
100   
101    /**
102    * Set proof list.
103    *
104    * @param proofList Proof list.
105    */
 
106  86 toggle public final void setProofList(final ProofListVo proofList) {
107  86 this.proofList = proofList;
108    }
109   
 
110  3323 toggle public final ProofList getProofList() {
111  3323 return proofList;
112    }
113   
114    /**
115    * Add proof to this list.
116    *
117    * @param proof Proof to add.
118    */
 
119  103 toggle public final void addProof(final ProofVo proof) {
120  103 if (proofList == null) {
121  91 proofList = new ProofListVo();
122    }
123  103 proofList.add(proof);
124    }
125   
 
126  59 toggle public boolean equals(final Object obj) {
127  59 if (!(obj instanceof PropositionVo)) {
128  6 return false;
129    }
130  53 final PropositionVo other = (PropositionVo) obj;
131  53 return EqualsUtility.equals(getFormula(), other.getFormula())
132    && EqualsUtility.equals(getDescription(), other.getDescription())
133    && EqualsUtility.equals(getProofList(), other.getProofList());
134    }
135   
 
136  60 toggle public int hashCode() {
137  60 return (getFormula() != null ? getFormula().hashCode() : 0)
138  60 ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0)
139  60 ^ (getProofList() != null ? 2 ^ getProofList().hashCode() : 0);
140    }
141   
 
142  44 toggle public String toString() {
143  44 final StringBuffer buffer = new StringBuffer();
144  44 buffer.append("Proposition:\n");
145  44 buffer.append(getFormula());
146  44 buffer.append("\nDescription:\n");
147  44 buffer.append(getDescription());
148  44 buffer.append("\nProof:\n");
149  44 buffer.append(getProofList());
150  44 return buffer.toString();
151    }
152   
153    }