Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
14   109   14   1.4
8   46   1   10
10     1.4  
1    
 
  HypothesisVo       Line # 28 14 14 100% 1.0
 
  (11)
 
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.Formula;
20    import org.qedeq.kernel.se.base.module.Hypothesis;
21   
22   
23    /**
24    * Hypothesis that can be used as an assumption within a proof.
25    *
26    * @author Michael Meyling
27    */
 
28    public class HypothesisVo implements Hypothesis {
29   
30    /** Label for back references. Might be <code>null</code>. */
31    private String label;
32   
33    /** Derived formula. */
34    private Formula formula;
35   
36    /**
37    * Constructs an proof line.
38    *
39    * @param formula New derived formula.
40    */
 
41  3 toggle public HypothesisVo(final Formula formula) {
42  3 this.label = null;
43  3 this.formula = formula;
44    }
45   
46    /**
47    * Constructs an proof line.
48    *
49    * @param label Label for back references. Might be <code>null</code>.
50    * @param formula New derived formula.
51    */
 
52  6 toggle public HypothesisVo(final String label, final Formula formula) {
53  6 this.label = label;
54  6 this.formula = formula;
55    }
56   
57    /**
58    * Default constructor.
59    */
 
60  526 toggle public HypothesisVo() {
61    // nothing to do
62    }
63   
 
64  16276 toggle public Formula getFormula() {
65  16276 return formula;
66    }
67   
68    /**
69    * Set proof line formula.
70    *
71    * @param formula Set formula.
72    */
 
73  499 toggle public void setFormula(final Formula formula) {
74  499 this.formula = formula;
75    }
76   
 
77  4086 toggle public String getLabel() {
78  4086 return label;
79    }
80   
81    /**
82    * Set label for proof line.
83    *
84    * @param label Set this label.
85    */
 
86  496 toggle public void setLabel(final String label) {
87  496 this.label = label;
88    }
89   
 
90  88 toggle public boolean equals(final Object obj) {
91  88 if (!(obj instanceof HypothesisVo)) {
92  11 return false;
93    }
94  77 final HypothesisVo other = (HypothesisVo) obj;
95  77 return EqualsUtility.equals(label, other.label)
96    && EqualsUtility.equals(formula, other.formula);
97    }
98   
 
99  96 toggle public int hashCode() {
100  96 return (label != null ? label.hashCode() : 0)
101  96 ^ (formula != null ? 1 ^ formula.hashCode() : 0);
102    }
103   
 
104  66 toggle public String toString() {
105  66 return (label != null ? "[" + label + "] " : " ") + getFormula() + " "
106    + "Hypothesis";
107    }
108   
109    }