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