1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.base.io; |
17 |
|
|
18 |
|
import java.io.Serializable; |
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
@author |
25 |
|
|
|
|
| 79.3% |
Uncovered Elements: 6 (29) |
Complexity: 13 |
Complexity Density: 0.81 |
|
26 |
|
public final class SourceArea implements Serializable { |
27 |
|
|
28 |
|
|
29 |
|
private final String address; |
30 |
|
|
31 |
|
|
32 |
|
private final SourcePosition startPosition; |
33 |
|
|
34 |
|
|
35 |
|
private final SourcePosition endPosition; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@param |
41 |
|
@param |
42 |
|
@param |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 4 |
Complexity Density: 0.8 |
|
44 |
38
|
public SourceArea(final String address, final SourcePosition startPosition,... |
45 |
|
final SourcePosition endPosition) { |
46 |
38
|
this.address = address; |
47 |
38
|
if (address == null || startPosition == null || endPosition == null) { |
48 |
3
|
throw new NullPointerException(); |
49 |
|
} |
50 |
35
|
this.startPosition = startPosition; |
51 |
35
|
this.endPosition = endPosition; |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
@param |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
0
|
public SourceArea(final String address) {... |
60 |
0
|
this(address, SourcePosition.BEGIN, SourcePosition.BEGIN); |
61 |
|
} |
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
@return |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
73
|
public final String getAddress() {... |
69 |
73
|
return this.address; |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
@return |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
94
|
public final SourcePosition getStartPosition() {... |
78 |
94
|
return startPosition; |
79 |
|
} |
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
@return |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
78
|
public final SourcePosition getEndPosition() {... |
87 |
78
|
return endPosition; |
88 |
|
} |
89 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
14
|
public final int hashCode() {... |
91 |
14
|
return getAddress().hashCode() ^ getStartPosition().hashCode() ^ getEndPosition().hashCode(); |
92 |
|
} |
93 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
94 |
14
|
public final boolean equals(final Object obj) {... |
95 |
14
|
if (!(obj instanceof SourceArea)) { |
96 |
0
|
return false; |
97 |
|
} |
98 |
14
|
final SourceArea other = (SourceArea) obj; |
99 |
14
|
return getAddress().equals(other.getAddress()) |
100 |
|
&& getStartPosition().equals(other.getStartPosition()) |
101 |
|
&& getEndPosition().equals(other.getEndPosition()); |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
@return |
108 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
0
|
public final String getShortDescription() {... |
110 |
0
|
return getStartPosition().getRow() + ":" + getStartPosition().getColumn() |
111 |
|
+ " - " + getEndPosition().getRow() + ":" + getEndPosition().getColumn(); |
112 |
|
} |
113 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
114 |
28
|
public final String toString() {... |
115 |
28
|
return getAddress() + ":" + getStartPosition().getRow() + ":" + getStartPosition().getColumn() |
116 |
|
+ ":" + getEndPosition().getRow() + ":" + getEndPosition().getColumn(); |
117 |
|
} |
118 |
|
|
119 |
|
} |