1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| package org.qedeq.kernel.dto.module; |
19 |
| |
20 |
| import org.qedeq.kernel.base.module.Axiom; |
21 |
| import org.qedeq.kernel.base.module.Formula; |
22 |
| import org.qedeq.kernel.base.module.FunctionDefinition; |
23 |
| import org.qedeq.kernel.base.module.LatexList; |
24 |
| import org.qedeq.kernel.base.module.PredicateDefinition; |
25 |
| import org.qedeq.kernel.base.module.ProofList; |
26 |
| import org.qedeq.kernel.base.module.Proposition; |
27 |
| import org.qedeq.kernel.base.module.Rule; |
28 |
| import org.qedeq.kernel.utility.EqualsUtility; |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| public final class PropositionVo implements Proposition { |
38 |
| |
39 |
| |
40 |
| private Formula formula; |
41 |
| |
42 |
| |
43 |
| private LatexList description; |
44 |
| |
45 |
| |
46 |
| private ProofListVo proofList; |
47 |
| |
48 |
| |
49 |
| |
50 |
| |
51 |
382
| public PropositionVo() {
|
52 |
| |
53 |
| } |
54 |
| |
55 |
0
| public Axiom getAxiom() {
|
56 |
0
| return null;
|
57 |
| } |
58 |
| |
59 |
0
| public PredicateDefinition getPredicateDefinition() {
|
60 |
0
| return null;
|
61 |
| } |
62 |
| |
63 |
0
| public FunctionDefinition getFunctionDefinition() {
|
64 |
0
| return null;
|
65 |
| } |
66 |
| |
67 |
314
| public Proposition getProposition() {
|
68 |
314
| return this;
|
69 |
| } |
70 |
| |
71 |
0
| public Rule getRule() {
|
72 |
0
| return null;
|
73 |
| } |
74 |
| |
75 |
| |
76 |
| |
77 |
| |
78 |
| |
79 |
| |
80 |
352
| public final void setFormula(final FormulaVo formula) {
|
81 |
352
| this.formula = formula;
|
82 |
| } |
83 |
| |
84 |
1269
| public final Formula getFormula() {
|
85 |
1269
| return formula;
|
86 |
| } |
87 |
| |
88 |
| |
89 |
| |
90 |
| |
91 |
| |
92 |
| |
93 |
22
| public final void setDescription(final LatexListVo description) {
|
94 |
22
| this.description = description;
|
95 |
| } |
96 |
| |
97 |
612
| public LatexList getDescription() {
|
98 |
612
| return description;
|
99 |
| } |
100 |
| |
101 |
| |
102 |
| |
103 |
| |
104 |
| |
105 |
| |
106 |
31
| public final void setProofList(final ProofListVo proofList) {
|
107 |
31
| this.proofList = proofList;
|
108 |
| } |
109 |
| |
110 |
683
| public final ProofList getProofList() {
|
111 |
683
| return proofList;
|
112 |
| } |
113 |
| |
114 |
| |
115 |
| |
116 |
| |
117 |
| |
118 |
| |
119 |
33
| public final void addProof(final ProofVo proof) {
|
120 |
33
| if (proofList == null) {
|
121 |
28
| proofList = new ProofListVo();
|
122 |
| } |
123 |
33
| proofList.add(proof);
|
124 |
| } |
125 |
| |
126 |
59
| 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
| 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
| 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 |
| } |