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.Existential; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@author |
28 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (59) |
Complexity: 21 |
Complexity Density: 0.68 |
|
29 |
|
public class ExistentialVo implements Existential { |
30 |
|
|
31 |
|
|
32 |
|
private String reference; |
33 |
|
|
34 |
|
|
35 |
|
private Element subjectVariable; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@param |
41 |
|
@param |
42 |
|
|
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
44 |
4
|
public ExistentialVo(final String reference, final Element subjectVariable) {... |
45 |
4
|
this.reference = reference; |
46 |
4
|
this.subjectVariable = subjectVariable; |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
52 |
42
|
public ExistentialVo() {... |
53 |
|
|
54 |
|
} |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
5
|
public Existential getExistential() {... |
57 |
5
|
return this; |
58 |
|
} |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
3
|
public String getReference() {... |
61 |
3
|
return reference; |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
@param |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
16
|
public void setReference(final String reference) {... |
70 |
16
|
this.reference = reference; |
71 |
|
} |
72 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
73 |
2
|
public String[] getReferences() {... |
74 |
2
|
if (reference == null) { |
75 |
1
|
return ArrayUtils.EMPTY_STRING_ARRAY; |
76 |
|
} |
77 |
1
|
return new String[] {reference }; |
78 |
|
} |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
8
|
public Element getSubjectVariable() {... |
81 |
8
|
return subjectVariable; |
82 |
|
} |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
@param |
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
89 |
18
|
public void setSubjectVariable(final Element subjectVariable) {... |
90 |
18
|
this.subjectVariable = subjectVariable; |
91 |
|
} |
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
93 |
32
|
public String getName() {... |
94 |
32
|
return "Existential"; |
95 |
|
} |
96 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
97 |
35
|
public boolean equals(final Object obj) {... |
98 |
35
|
if (!(obj instanceof ExistentialVo)) { |
99 |
4
|
return false; |
100 |
|
} |
101 |
31
|
final ExistentialVo other = (ExistentialVo) obj; |
102 |
31
|
return EqualsUtility.equals(reference, other.reference) |
103 |
|
&& EqualsUtility.equals(subjectVariable, other.subjectVariable); |
104 |
|
} |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 3 |
Complexity Density: 3 |
|
106 |
40
|
public int hashCode() {... |
107 |
40
|
return (reference != null ? reference.hashCode() : 0) |
108 |
40
|
^ (subjectVariable != null ? 2 ^ subjectVariable.hashCode() : 0); |
109 |
|
} |
110 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (23) |
Complexity: 6 |
Complexity Density: 0.4 |
|
111 |
30
|
public String toString() {... |
112 |
30
|
StringBuffer result = new StringBuffer(); |
113 |
30
|
result.append(getName()); |
114 |
30
|
if (reference != null || subjectVariable != null) { |
115 |
17
|
result.append(" ("); |
116 |
17
|
boolean w = false; |
117 |
17
|
if (reference != null) { |
118 |
16
|
result.append(reference); |
119 |
16
|
w = true; |
120 |
|
} |
121 |
17
|
if (subjectVariable != null) { |
122 |
14
|
if (w) { |
123 |
13
|
result.append(", "); |
124 |
|
} |
125 |
14
|
result.append(subjectVariable); |
126 |
14
|
w = true; |
127 |
|
} |
128 |
17
|
result.append(")"); |
129 |
|
} |
130 |
30
|
return result.toString(); |
131 |
|
} |
132 |
|
|
133 |
|
} |