|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HypothesisVo | Line # 28 | 14 | 14 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(11) | |||
Result | |||
0.8125
|
org.qedeq.kernel.se.test.AbstractValueObjectTestCase.testAll org.qedeq.kernel.se.test.AbstractValueObjectTestCase.testAll | 1 PASS | |
0.8125
|
org.qedeq.kernel.se.test.AbstractValueObjectTestCase.testAll org.qedeq.kernel.se.test.AbstractValueObjectTestCase.testAll | 1 PASS | |
0.65625
|
org.qedeq.kernel.se.test.AbstractValueObjectTestCase.testAll org.qedeq.kernel.se.test.AbstractValueObjectTestCase.testAll | 1 PASS | |
0.28125
|
org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration | 1 PASS | |
0.28125
|
org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration | 1 PASS | |
0.28125
|
org.qedeq.kernel.bo.service.unicode.GenerateUtf8Test.testGeneration1b org.qedeq.kernel.bo.service.unicode.GenerateUtf8Test.testGeneration1b | 1 PASS | |
0.28125
|
org.qedeq.kernel.xml.dao.GenerateXmlTest.testGeneration org.qedeq.kernel.xml.dao.GenerateXmlTest.testGeneration | 1 PASS | |
0.28125
|
org.qedeq.kernel.bo.service.logic.FormalProofCheckerPluginTest.testPlugin4 org.qedeq.kernel.bo.service.logic.FormalProofCheckerPluginTest.testPlugin4 | 1 PASS | |
0.15625
|
org.qedeq.kernel.se.visitor.QedeqNotNullTraverserTest.testQedeq org.qedeq.kernel.se.visitor.QedeqNotNullTraverserTest.testQedeq | 1 PASS | |
0.0625
|
org.qedeq.kernel.se.dto.module.HypothesisVoTest.testGetLabel org.qedeq.kernel.se.dto.module.HypothesisVoTest.testGetLabel | 1 PASS | |
0.0625
|
org.qedeq.kernel.se.dto.module.HypothesisVoTest.testGetFormula org.qedeq.kernel.se.dto.module.HypothesisVoTest.testGetFormula | 1 PASS | |
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 | 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 | 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 | public HypothesisVo() { |
61 | // nothing to do | |
62 | } | |
63 | ||
64 | 16276 | public Formula getFormula() { |
65 | 16276 | return formula; |
66 | } | |
67 | ||
68 | /** | |
69 | * Set proof line formula. | |
70 | * | |
71 | * @param formula Set formula. | |
72 | */ | |
73 | 499 | public void setFormula(final Formula formula) { |
74 | 499 | this.formula = formula; |
75 | } | |
76 | ||
77 | 4086 | 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 | public void setLabel(final String label) { |
87 | 496 | this.label = label; |
88 | } | |
89 | ||
90 | 88 | 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 | public int hashCode() { |
100 | 96 | return (label != null ? label.hashCode() : 0) |
101 | 96 | ^ (formula != null ? 1 ^ formula.hashCode() : 0); |
102 | } | |
103 | ||
104 | 66 | public String toString() { |
105 | 66 | return (label != null ? "[" + label + "] " : " ") + getFormula() + " " |
106 | + "Hypothesis"; | |
107 | } | |
108 | ||
109 | } |
|