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.SubstFunc; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@author |
28 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (76) |
Complexity: 27 |
Complexity Density: 0.68 |
|
29 |
|
public class SubstFuncVo implements SubstFunc { |
30 |
|
|
31 |
|
|
32 |
|
private String reference; |
33 |
|
|
34 |
|
|
35 |
|
private Element functionVariable; |
36 |
|
|
37 |
|
|
38 |
|
private Element substituteTerm; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
@param |
44 |
|
@param |
45 |
|
@param |
46 |
|
|
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
48 |
114
|
public SubstFuncVo(final String reference, final Element functionVariable,... |
49 |
|
final Element substituteFormula) { |
50 |
114
|
this.reference = reference; |
51 |
114
|
this.functionVariable = functionVariable; |
52 |
114
|
this.substituteTerm = substituteFormula; |
53 |
|
} |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
58 |
49
|
public SubstFuncVo() {... |
59 |
|
|
60 |
|
} |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
296
|
public SubstFunc getSubstFunc() {... |
63 |
296
|
return this; |
64 |
|
} |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
111
|
public String getReference() {... |
67 |
111
|
return reference; |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
@param |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
16
|
public void setReference(final String reference) {... |
76 |
16
|
this.reference = reference; |
77 |
|
} |
78 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
79 |
2
|
public String[] getReferences() {... |
80 |
2
|
if (reference == null) { |
81 |
1
|
return ArrayUtils.EMPTY_STRING_ARRAY; |
82 |
|
} |
83 |
1
|
return new String[] {reference }; |
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
273
|
public Element getFunctionVariable() {... |
87 |
273
|
return functionVariable; |
88 |
|
} |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
@param |
94 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
18
|
public void setFunctionVariable(final Element functionVariable) {... |
96 |
18
|
this.functionVariable = functionVariable; |
97 |
|
} |
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
466
|
public Element getSubstituteTerm() {... |
100 |
466
|
return substituteTerm; |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
@param |
107 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
108 |
18
|
public void setSubstituteTerm(final Element substituteTerm) {... |
109 |
18
|
this.substituteTerm = substituteTerm; |
110 |
|
} |
111 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
82
|
public String getName() {... |
113 |
82
|
return "SubstFun"; |
114 |
|
} |
115 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
116 |
47
|
public boolean equals(final Object obj) {... |
117 |
47
|
if (!(obj instanceof SubstFuncVo)) { |
118 |
5
|
return false; |
119 |
|
} |
120 |
42
|
final SubstFuncVo other = (SubstFuncVo) obj; |
121 |
42
|
return EqualsUtility.equals(reference, other.reference) |
122 |
|
&& EqualsUtility.equals(functionVariable, other.functionVariable) |
123 |
|
&& EqualsUtility.equals(substituteTerm, other.substituteTerm); |
124 |
|
} |
125 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 4 |
Complexity Density: 4 |
|
126 |
52
|
public int hashCode() {... |
127 |
52
|
return (reference != null ? reference.hashCode() : 0) |
128 |
52
|
^ (functionVariable != null ? 2 ^ functionVariable.hashCode() : 0) |
129 |
52
|
^ (substituteTerm != null ? 3 ^ substituteTerm.hashCode() : 0); |
130 |
|
} |
131 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 9 |
Complexity Density: 0.43 |
|
132 |
54
|
public String toString() {... |
133 |
54
|
StringBuffer result = new StringBuffer(); |
134 |
54
|
result.append(getName()); |
135 |
54
|
if (reference != null || functionVariable != null |
136 |
|
|| substituteTerm != null) { |
137 |
38
|
result.append(" ("); |
138 |
38
|
boolean w = false; |
139 |
38
|
if (reference != null) { |
140 |
36
|
result.append(reference); |
141 |
36
|
w = true; |
142 |
|
} |
143 |
38
|
if (functionVariable != null) { |
144 |
24
|
if (w) { |
145 |
23
|
result.append(", "); |
146 |
|
} |
147 |
24
|
result.append(functionVariable); |
148 |
24
|
w = true; |
149 |
|
} |
150 |
38
|
if (substituteTerm != null) { |
151 |
32
|
if (w) { |
152 |
31
|
result.append(", "); |
153 |
|
} |
154 |
32
|
result.append("by "); |
155 |
32
|
result.append(substituteTerm); |
156 |
32
|
w = true; |
157 |
|
} |
158 |
38
|
result.append(")"); |
159 |
|
} |
160 |
54
|
return result.toString(); |
161 |
|
} |
162 |
|
|
163 |
|
} |