|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.qedeq.kernel.bo.module; |
|
19 |
| |
|
20 |
| import org.qedeq.kernel.base.module.Axiom; |
|
21 |
| import org.qedeq.kernel.base.module.FunctionDefinition; |
|
22 |
| import org.qedeq.kernel.base.module.PredicateDefinition; |
|
23 |
| import org.qedeq.kernel.base.module.FormulaOrTerm; |
|
24 |
| import org.qedeq.kernel.base.module.LatexList; |
|
25 |
| import org.qedeq.kernel.base.module.Proof; |
|
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 |
| import org.qedeq.kernel.utility.EqualsUtility; |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
| public final class PropositionBo implements Proposition { |
|
39 |
| |
|
40 |
| |
|
41 |
| private FormulaOrTerm formula; |
|
42 |
| |
|
43 |
| |
|
44 |
| private ProofListBo proofList; |
|
45 |
| |
|
46 |
| |
|
47 |
| private LatexList description; |
|
48 |
| |
|
49 |
| |
|
50 |
| |
|
51 |
| |
|
52 |
208
| public PropositionBo() {
|
|
53 |
| |
|
54 |
| } |
|
55 |
| |
|
56 |
0
| public Axiom getAxiom() {
|
|
57 |
0
| return null;
|
|
58 |
| } |
|
59 |
| |
|
60 |
0
| public PredicateDefinition getPredicateDefinition() {
|
|
61 |
0
| return null;
|
|
62 |
| } |
|
63 |
| |
|
64 |
0
| public FunctionDefinition getFunctionDefinition() {
|
|
65 |
0
| return null;
|
|
66 |
| } |
|
67 |
| |
|
68 |
0
| public Proposition getProposition() {
|
|
69 |
0
| return this;
|
|
70 |
| } |
|
71 |
| |
|
72 |
0
| public Rule getRule() {
|
|
73 |
0
| return null;
|
|
74 |
| } |
|
75 |
| |
|
76 |
| |
|
77 |
| |
|
78 |
| |
|
79 |
| |
|
80 |
| |
|
81 |
178
| public final void setFormula(final FormulaOrTerm formula) {
|
|
82 |
178
| this.formula = formula;
|
|
83 |
| } |
|
84 |
| |
|
85 |
351
| public final FormulaOrTerm getFormula() {
|
|
86 |
351
| return formula;
|
|
87 |
| } |
|
88 |
| |
|
89 |
| |
|
90 |
| |
|
91 |
| |
|
92 |
| |
|
93 |
| |
|
94 |
31
| public final void setProofList(final ProofListBo proofList) {
|
|
95 |
31
| this.proofList = proofList;
|
|
96 |
| } |
|
97 |
| |
|
98 |
348
| public final ProofList getProofList() {
|
|
99 |
348
| return proofList;
|
|
100 |
| } |
|
101 |
| |
|
102 |
| |
|
103 |
| |
|
104 |
| |
|
105 |
| |
|
106 |
| |
|
107 |
7
| public final void addProof(final Proof proof) {
|
|
108 |
7
| if (proofList == null) {
|
|
109 |
2
| proofList = new ProofListBo();
|
|
110 |
| } |
|
111 |
7
| proofList.add(proof);
|
|
112 |
| } |
|
113 |
| |
|
114 |
| |
|
115 |
| |
|
116 |
| |
|
117 |
| |
|
118 |
| |
|
119 |
19
| public final void setDescription(final LatexList description) {
|
|
120 |
19
| this.description = description;
|
|
121 |
| } |
|
122 |
| |
|
123 |
333
| public LatexList getDescription() {
|
|
124 |
333
| return description;
|
|
125 |
| } |
|
126 |
| |
|
127 |
59
| public boolean equals(final Object obj) {
|
|
128 |
59
| if (!(obj instanceof PropositionBo)) {
|
|
129 |
6
| return false;
|
|
130 |
| } |
|
131 |
53
| final PropositionBo other = (PropositionBo) obj;
|
|
132 |
53
| return EqualsUtility.equals(getFormula(), other.getFormula())
|
|
133 |
| && EqualsUtility.equals(getDescription(), other.getDescription()) |
|
134 |
| && EqualsUtility.equals(getProofList(), other.getProofList()); |
|
135 |
| } |
|
136 |
| |
|
137 |
60
| public int hashCode() {
|
|
138 |
60
| return (getFormula() != null ? getFormula().hashCode() : 0)
|
|
139 |
60
| ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0)
|
|
140 |
60
| ^ (getProofList() != null ? 2 ^ getProofList().hashCode() : 0);
|
|
141 |
| } |
|
142 |
| |
|
143 |
44
| public String toString() {
|
|
144 |
44
| final StringBuffer buffer = new StringBuffer();
|
|
145 |
44
| buffer.append("Proposition:\n");
|
|
146 |
44
| buffer.append(getFormula());
|
|
147 |
44
| buffer.append("Description:\n");
|
|
148 |
44
| buffer.append(getDescription());
|
|
149 |
44
| buffer.append("Proof:\n");
|
|
150 |
44
| buffer.append(getProofList());
|
|
151 |
44
| return buffer.toString();
|
|
152 |
| } |
|
153 |
| |
|
154 |
| } |