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 java.util.ArrayList; |
19 |
|
import java.util.List; |
20 |
|
|
21 |
|
import org.qedeq.base.utility.EqualsUtility; |
22 |
|
import org.qedeq.kernel.se.base.module.FormalProof; |
23 |
|
import org.qedeq.kernel.se.base.module.FormalProofList; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (51) |
Complexity: 16 |
Complexity Density: 0.62 |
|
31 |
|
public class FormalProofListVo implements FormalProofList { |
32 |
|
|
33 |
|
|
34 |
|
private final List list; |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
90
|
public FormalProofListVo() {... |
40 |
90
|
this.list = new ArrayList(); |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
@param |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
81
|
public final void add(final FormalProofVo proof) {... |
49 |
81
|
list.add(proof); |
50 |
|
} |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
540
|
public final int size() {... |
53 |
540
|
return list.size(); |
54 |
|
} |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
485
|
public final FormalProof get(final int index) {... |
57 |
485
|
return (FormalProof) list.get(index); |
58 |
|
} |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 5 |
Complexity Density: 0.56 |
|
60 |
55
|
public boolean equals(final Object obj) {... |
61 |
55
|
if (!(obj instanceof FormalProofListVo)) { |
62 |
7
|
return false; |
63 |
|
} |
64 |
48
|
final FormalProofListVo otherList = (FormalProofListVo) obj; |
65 |
48
|
if (size() != otherList.size()) { |
66 |
11
|
return false; |
67 |
|
} |
68 |
86
|
for (int i = 0; i < size(); i++) { |
69 |
53
|
if (!EqualsUtility.equals(get(i), otherList.get(i))) { |
70 |
4
|
return false; |
71 |
|
} |
72 |
|
} |
73 |
33
|
return true; |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
76 |
50
|
public int hashCode() {... |
77 |
50
|
int hash = 0; |
78 |
138
|
for (int i = 0; i < size(); i++) { |
79 |
88
|
hash = hash ^ (i + 1); |
80 |
88
|
if (get(i) != null) { |
81 |
86
|
hash = hash ^ get(i).hashCode(); |
82 |
|
} |
83 |
|
} |
84 |
50
|
return hash; |
85 |
|
} |
86 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 4 |
Complexity Density: 0.57 |
|
87 |
42
|
public String toString() {... |
88 |
42
|
final StringBuffer buffer = new StringBuffer("Proofs:\n"); |
89 |
121
|
for (int i = 0; i < size(); i++) { |
90 |
79
|
if (i != 0) { |
91 |
40
|
buffer.append("\n"); |
92 |
|
} |
93 |
79
|
buffer.append((i + 1) + ":\t"); |
94 |
79
|
buffer.append(get(i) != null ? get(i).toString() : null); |
95 |
|
} |
96 |
42
|
return buffer.toString(); |
97 |
|
} |
98 |
|
|
99 |
|
} |