1
2
3
4
5
6
7
8
9
10
11
12
13
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.Axiom;
20 import org.qedeq.kernel.se.base.module.ChangedRuleList;
21 import org.qedeq.kernel.se.base.module.FunctionDefinition;
22 import org.qedeq.kernel.se.base.module.InitialFunctionDefinition;
23 import org.qedeq.kernel.se.base.module.InitialPredicateDefinition;
24 import org.qedeq.kernel.se.base.module.LatexList;
25 import org.qedeq.kernel.se.base.module.LinkList;
26 import org.qedeq.kernel.se.base.module.PredicateDefinition;
27 import org.qedeq.kernel.se.base.module.ProofList;
28 import org.qedeq.kernel.se.base.module.Proposition;
29 import org.qedeq.kernel.se.base.module.Rule;
30
31
32
33
34
35
36
37 public class RuleVo implements Rule {
38
39
40 private LinkListVo linkList;
41
42
43 private LatexList description;
44
45
46 private String name;
47
48
49 private String version;
50
51
52 private ChangedRuleListVo changedRuleList;
53
54
55 private ProofListVo proofList;
56
57
58
59
60 public RuleVo() {
61
62 }
63
64 public Axiom getAxiom() {
65 return null;
66 }
67
68 public InitialPredicateDefinition getInitialPredicateDefinition() {
69 return null;
70 }
71
72 public PredicateDefinition getPredicateDefinition() {
73 return null;
74 }
75
76 public InitialFunctionDefinition getInitialFunctionDefinition() {
77 return null;
78 }
79
80 public FunctionDefinition getFunctionDefinition() {
81 return null;
82 }
83
84 public Proposition getProposition() {
85 return null;
86 }
87
88 public Rule getRule() {
89 return this;
90 }
91
92
93
94
95
96
97 public final void setName(final String name) {
98 this.name = name;
99 }
100
101 public final String getName() {
102 return name;
103 }
104
105
106
107
108
109
110 public final void setVersion(final String version) {
111 this.version = version;
112 }
113
114 public final String getVersion() {
115 return version;
116 }
117
118
119
120
121
122
123 public final void setLinkList(final LinkListVo linkList) {
124 this.linkList = linkList;
125 }
126
127 public final LinkList getLinkList() {
128 return linkList;
129 }
130
131
132
133
134
135
136 public final void addLink(final String id) {
137 if (linkList == null) {
138 linkList = new LinkListVo();
139 }
140 linkList.add(id);
141 }
142
143
144
145
146
147
148 public final void setDescription(final LatexListVo description) {
149 this.description = description;
150 }
151
152 public LatexList getDescription() {
153 return description;
154 }
155
156
157
158
159
160
161 public final void setProofList(final ProofListVo proofList) {
162 this.proofList = proofList;
163 }
164
165 public final ProofList getProofList() {
166 return proofList;
167 }
168
169
170
171
172
173
174 public final void addProof(final ProofVo proof) {
175 if (proofList == null) {
176 proofList = new ProofListVo();
177 }
178 proofList.add(proof);
179 }
180
181
182
183
184
185
186 public final void setChangedRuleList(final ChangedRuleListVo changedRuleList) {
187 this.changedRuleList = changedRuleList;
188 }
189
190 public final ChangedRuleList getChangedRuleList() {
191 return changedRuleList;
192 }
193
194
195
196
197
198
199 public final void addChangedRule(final ChangedRuleVo changedRule) {
200 if (changedRuleList == null) {
201 changedRuleList = new ChangedRuleListVo();
202 }
203 changedRuleList.add(changedRule);
204 }
205
206 public boolean equals(final Object obj) {
207 if (!(obj instanceof RuleVo)) {
208 return false;
209 }
210 final RuleVo other = (RuleVo) obj;
211 return EqualsUtility.equals(getName(), other.getName())
212 && EqualsUtility.equals(getVersion(), other.getVersion())
213 && EqualsUtility.equals(getLinkList(), other.getLinkList())
214 && EqualsUtility.equals(getDescription(), other.getDescription())
215 && EqualsUtility.equals(getChangedRuleList(), other.getChangedRuleList())
216 && EqualsUtility.equals(getProofList(), other.getProofList());
217 }
218
219 public int hashCode() {
220 return (getName() != null ? 1 ^ getName().hashCode() : 0)
221 ^ (getVersion() != null ? 2 ^ getVersion().hashCode() : 0)
222 ^ (getLinkList() != null ? 3 ^ getLinkList().hashCode() : 0)
223 ^ (getDescription() != null ? 4 ^ getDescription().hashCode() : 0)
224 ^ (getChangedRuleList() != null ? 5 ^ getChangedRuleList().hashCode() : 0)
225 ^ (getProofList() != null ? 6 ^ getProofList().hashCode() : 0);
226 }
227
228 public String toString() {
229 final StringBuffer buffer = new StringBuffer();
230 buffer.append("Rule: " + getName() + " [" + getVersion() + "]\n");
231 buffer.append(getLinkList());
232 buffer.append("\nDescription:\n");
233 buffer.append(getDescription());
234 buffer.append(getProofList());
235 buffer.append(getChangedRuleList());
236 return buffer.toString();
237 }
238 }