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