1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.qedeq.kernel.bo.logic.proof.finder;
17
18 import org.qedeq.base.utility.EqualsUtility;
19 import org.qedeq.kernel.se.base.module.ModusPonens;
20
21
22
23
24
25
26
27 public class ModusPonensBo implements ModusPonens {
28
29
30 private int n1;
31
32
33 private int n2;
34
35
36
37
38
39
40
41 public ModusPonensBo(final int n1, final int n2) {
42 this.n1 = n1;
43 this.n2 = n2;
44 }
45
46 public ModusPonens getModusPonens() {
47 return this;
48 }
49
50 public String getReference1() {
51 return "" + n1;
52 }
53
54
55
56
57
58
59 public void setN1(final int n1) {
60 this.n1 = n1;
61 }
62
63
64
65
66
67
68 public int getN1() {
69 return n1;
70 }
71
72 public String getReference2() {
73 return "" + n2;
74 }
75
76
77
78
79
80
81 public void setN2(final int n2) {
82 this.n2 = n2;
83 }
84
85
86
87
88
89
90 public int getN2() {
91 return n2;
92 }
93
94 public String[] getReferences() {
95 return new String[] {getReference1(), getReference2()};
96 }
97
98
99
100
101
102
103 public int[] getLines() {
104 return new int[] {getN1(), getN2()};
105 }
106
107 public boolean equals(final Object obj) {
108 if (!(obj instanceof ModusPonens)) {
109 return false;
110 }
111 final ModusPonens other = (ModusPonens) obj;
112 return EqualsUtility.equals(getReference1(), other.getReference1())
113 && EqualsUtility.equals(getReference2(), other.getReference2());
114 }
115
116 public int hashCode() {
117 return getReference1().hashCode() ^ getReference2().hashCode();
118 }
119
120 public String toString() {
121 StringBuffer result = new StringBuffer();
122 result.append("MP");
123 result.append(" (");
124 if (getReference1() != null) {
125 result.append(getReference1());
126 }
127 if (getReference2() != null) {
128 if (getReference1() != null) {
129 result.append(", ");
130 }
131 result.append(getReference2());
132 }
133 result.append(")");
134 return result.toString();
135 }
136
137 public String getName() {
138 return "MP";
139 }
140
141 }