1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.logic.model; |
17 |
|
|
18 |
|
import org.qedeq.base.utility.Enumerator; |
19 |
|
import org.qedeq.kernel.bo.logic.common.SubjectVariable; |
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
@author |
25 |
|
|
|
|
| 78.6% |
Uncovered Elements: 6 (28) |
Complexity: 10 |
Complexity Density: 0.62 |
|
26 |
|
public class SubjectVariableAllocation { |
27 |
|
|
28 |
|
|
29 |
|
private final SubjectVariable variable; |
30 |
|
|
31 |
|
|
32 |
|
private final Enumerator value; |
33 |
|
|
34 |
|
|
35 |
|
private boolean fixed; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@param |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
42 |
177337
|
public SubjectVariableAllocation(final SubjectVariable variable) {... |
43 |
177337
|
this.variable = variable; |
44 |
177337
|
this.value = new Enumerator(); |
45 |
177337
|
this.fixed = false; |
46 |
|
} |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@param |
52 |
|
@param |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
54 |
29757
|
public SubjectVariableAllocation(final SubjectVariable variable, final int value) {... |
55 |
29757
|
this.variable = variable; |
56 |
29757
|
this.value = new Enumerator(value); |
57 |
29757
|
this.fixed = true; |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@return |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
1288559
|
public SubjectVariable getVariable() {... |
66 |
1288559
|
return variable; |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
@return |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
206672
|
public boolean isFixed() {... |
75 |
206672
|
return fixed; |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
@return |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
619724
|
public int getValue() {... |
84 |
619724
|
return value.getNumber(); |
85 |
|
} |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
90 |
288461
|
public void increaseNumber() {... |
91 |
288461
|
if (fixed) { |
92 |
0
|
throw new IllegalStateException("variable could not iterate: " + toString()); |
93 |
|
} |
94 |
288461
|
value.increaseNumber(); |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
100 |
1052
|
public void resetNumber() {... |
101 |
1052
|
if (fixed) { |
102 |
0
|
throw new IllegalStateException("variable could not iterate: " + toString()); |
103 |
|
} |
104 |
1052
|
value.reset(); |
105 |
|
} |
106 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0
|
public String toString() {... |
108 |
0
|
return variable.toString() + "=" + value.getNumber(); |
109 |
|
} |
110 |
|
|
111 |
|
} |