1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.datamodel; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 8 |
Complexity Density: 0.42 |
|
27 |
|
public class SequenceCursor |
28 |
|
{ |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
public final SequenceI sequence; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
public final int residuePosition; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
public final int columnPosition; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
public final int firstColumnPosition; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
public final int lastColumnPosition; |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
public final int token; |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@param |
64 |
|
|
65 |
|
@param |
66 |
|
|
67 |
|
@param |
68 |
|
|
69 |
|
@param |
70 |
|
|
71 |
|
|
72 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
73 |
0 |
public SequenceCursor(SequenceI seq, int resPos, int column, int tok)... |
74 |
|
{ |
75 |
0 |
this(seq, resPos, column, 0, 0, tok); |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
@param |
82 |
|
|
83 |
|
@param |
84 |
|
|
85 |
|
@param |
86 |
|
|
87 |
|
@param |
88 |
|
|
89 |
|
|
90 |
|
@param |
91 |
|
|
92 |
|
|
93 |
|
@param |
94 |
|
|
95 |
|
|
96 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
97 |
0 |
public SequenceCursor(SequenceI seq, int resPos, int column,... |
98 |
|
int firstResCol, int lastResCol, int tok) |
99 |
|
{ |
100 |
0 |
sequence = seq; |
101 |
0 |
residuePosition = resPos; |
102 |
0 |
columnPosition = column; |
103 |
0 |
firstColumnPosition = firstResCol; |
104 |
0 |
lastColumnPosition = lastResCol; |
105 |
0 |
token = tok; |
106 |
|
} |
107 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
108 |
0 |
@Override... |
109 |
|
public int hashCode() |
110 |
|
{ |
111 |
0 |
int hash = 31 * residuePosition; |
112 |
0 |
hash = 31 * hash + columnPosition; |
113 |
0 |
hash = 31 * hash + token; |
114 |
0 |
if (sequence != null) |
115 |
|
{ |
116 |
0 |
hash += sequence.hashCode(); |
117 |
|
} |
118 |
0 |
return hash; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
125 |
0 |
@Override... |
126 |
|
public boolean equals(Object obj) |
127 |
|
{ |
128 |
0 |
if (!(obj instanceof SequenceCursor)) |
129 |
|
{ |
130 |
0 |
return false; |
131 |
|
} |
132 |
0 |
SequenceCursor sc = (SequenceCursor) obj; |
133 |
0 |
return sequence == sc.sequence && residuePosition == sc.residuePosition |
134 |
|
&& columnPosition == sc.columnPosition && token == sc.token; |
135 |
|
} |
136 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
137 |
0 |
@Override... |
138 |
|
public String toString() |
139 |
|
{ |
140 |
0 |
String name = sequence == null ? "" : sequence.getName(); |
141 |
0 |
return String.format("%s:Pos%d:Col%d:startCol%d:endCol%d:tok%d", name, |
142 |
|
residuePosition, columnPosition, firstColumnPosition, |
143 |
|
lastColumnPosition, token); |
144 |
|
} |
145 |
|
} |