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.apache.commons.lang.ArrayUtils; |
19 |
|
import org.qedeq.base.utility.EqualsUtility; |
20 |
|
import org.qedeq.kernel.se.base.list.Element; |
21 |
|
import org.qedeq.kernel.se.base.module.Rename; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@author |
28 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (91) |
Complexity: 32 |
Complexity Density: 0.65 |
|
29 |
|
public class RenameVo implements Rename { |
30 |
|
|
31 |
|
|
32 |
|
private String reference; |
33 |
|
|
34 |
|
|
35 |
|
private Element originalSubjectVariable; |
36 |
|
|
37 |
|
|
38 |
|
private Element replacementSubjectVariable; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
private int occurrence; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
@param |
48 |
|
@param |
49 |
|
@param |
50 |
|
@param |
51 |
|
|
52 |
|
|
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
54 |
4
|
public RenameVo(final String reference, final Element originalSubjectVariable,... |
55 |
|
final Element replacementSubjectVariable, final int occurrence) { |
56 |
4
|
this.reference = reference; |
57 |
4
|
this.originalSubjectVariable = originalSubjectVariable; |
58 |
4
|
this.replacementSubjectVariable = replacementSubjectVariable; |
59 |
4
|
this.occurrence = occurrence; |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
65 |
54
|
public RenameVo() {... |
66 |
|
|
67 |
|
} |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
7
|
public Rename getRename() {... |
70 |
7
|
return this; |
71 |
|
} |
72 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
73 |
3
|
public String getReference() {... |
74 |
3
|
return reference; |
75 |
|
} |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
@param |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
16
|
public void setReference(final String reference) {... |
83 |
16
|
this.reference = reference; |
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
86 |
2
|
public String[] getReferences() {... |
87 |
2
|
if (reference == null) { |
88 |
1
|
return ArrayUtils.EMPTY_STRING_ARRAY; |
89 |
|
} |
90 |
1
|
return new String[] {reference }; |
91 |
|
} |
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
93 |
3
|
public int getOccurrence() {... |
94 |
3
|
return occurrence; |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
@param |
101 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
16
|
public void setOccurrence(final int occurrence) {... |
103 |
16
|
this.occurrence = occurrence; |
104 |
|
} |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
106 |
10
|
public Element getOriginalSubjectVariable() {... |
107 |
10
|
return originalSubjectVariable; |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
@param |
114 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
18
|
public void setOriginalSubjectVariable(final Element originalSubjectVariable) {... |
116 |
18
|
this.originalSubjectVariable = originalSubjectVariable; |
117 |
|
} |
118 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
119 |
10
|
public Element getReplacementSubjectVariable() {... |
120 |
10
|
return replacementSubjectVariable; |
121 |
|
} |
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
@param |
127 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
18
|
public void setReplacementSubjectVariable(final Element replacementSubjectVariable) {... |
129 |
18
|
this.replacementSubjectVariable = replacementSubjectVariable; |
130 |
|
} |
131 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
44
|
public String getName() {... |
133 |
44
|
return "Rename"; |
134 |
|
} |
135 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
136 |
59
|
public boolean equals(final Object obj) {... |
137 |
59
|
if (!(obj instanceof RenameVo)) { |
138 |
6
|
return false; |
139 |
|
} |
140 |
53
|
final RenameVo other = (RenameVo) obj; |
141 |
53
|
return EqualsUtility.equals(reference, other.reference) |
142 |
|
&& EqualsUtility.equals(originalSubjectVariable, other.originalSubjectVariable) |
143 |
|
&& EqualsUtility.equals(replacementSubjectVariable, other.replacementSubjectVariable) |
144 |
|
&& (occurrence == other.occurrence); |
145 |
|
} |
146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 4 |
Complexity Density: 4 |
|
147 |
64
|
public int hashCode() {... |
148 |
64
|
return (reference != null ? reference.hashCode() : 0) |
149 |
64
|
^ (originalSubjectVariable != null ? 2 ^ originalSubjectVariable.hashCode() : 0) |
150 |
64
|
^ (replacementSubjectVariable != null ? 3 ^ replacementSubjectVariable.hashCode() : 0) |
151 |
|
^ (4 ^ occurrence); |
152 |
|
} |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (43) |
Complexity: 12 |
Complexity Density: 0.44 |
|
154 |
42
|
public String toString() {... |
155 |
42
|
StringBuffer result = new StringBuffer(); |
156 |
42
|
result.append(getName()); |
157 |
42
|
if (reference != null || originalSubjectVariable != null |
158 |
|
|| replacementSubjectVariable != null |
159 |
|
|| occurrence != 0) { |
160 |
29
|
result.append(" ("); |
161 |
29
|
boolean w = false; |
162 |
29
|
if (reference != null) { |
163 |
26
|
result.append(reference); |
164 |
26
|
w = true; |
165 |
|
} |
166 |
29
|
if (originalSubjectVariable != null) { |
167 |
16
|
if (w) { |
168 |
15
|
result.append(", "); |
169 |
|
} |
170 |
16
|
result.append(originalSubjectVariable); |
171 |
16
|
w = true; |
172 |
|
} |
173 |
29
|
if (replacementSubjectVariable != null) { |
174 |
14
|
if (w) { |
175 |
13
|
result.append(", "); |
176 |
|
} |
177 |
14
|
result.append("by "); |
178 |
14
|
result.append(replacementSubjectVariable); |
179 |
14
|
w = true; |
180 |
|
} |
181 |
29
|
if (occurrence != 0) { |
182 |
18
|
if (w) { |
183 |
17
|
result.append(", "); |
184 |
|
} |
185 |
18
|
result.append("occurrence: "); |
186 |
18
|
result.append(occurrence); |
187 |
18
|
w = true; |
188 |
|
} |
189 |
29
|
result.append(")"); |
190 |
|
} |
191 |
42
|
return result.toString(); |
192 |
|
} |
193 |
|
|
194 |
|
} |