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