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 |
|
import jalview.analysis.AlignSeq; |
24 |
|
import jalview.analysis.SeqsetUtils; |
25 |
|
import jalview.util.MessageManager; |
26 |
|
import jalview.util.ShiftList; |
27 |
|
|
28 |
|
import java.util.Enumeration; |
29 |
|
import java.util.Hashtable; |
30 |
|
|
|
|
| 70.4% |
Uncovered Elements: 97 (328) |
Complexity: 91 |
Complexity Density: 0.48 |
|
31 |
|
public class SeqCigar extends CigarSimple |
32 |
|
{ |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
private int start, end; |
37 |
|
|
38 |
|
private SequenceI refseq = null; |
39 |
|
|
40 |
|
private Hashtable seqProps; |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
@return |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
86 |
public SequenceI getRefSeq()... |
48 |
|
{ |
49 |
86 |
return refseq; |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@return |
55 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
0 |
public int getStart()... |
57 |
|
{ |
58 |
0 |
return start; |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@return |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
0 |
public int getEnd()... |
66 |
|
{ |
67 |
0 |
return end; |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
@param |
73 |
|
@return |
74 |
|
|
|
|
| 79.3% |
Uncovered Elements: 6 (29) |
Complexity: 10 |
Complexity Density: 0.67 |
|
75 |
133 |
public int findPosition(int column)... |
76 |
|
{ |
77 |
133 |
int w = 0, ew, p = refseq.findPosition(start); |
78 |
133 |
if (column < 0) |
79 |
|
{ |
80 |
0 |
return -1; |
81 |
|
} |
82 |
133 |
if (range != null) |
83 |
|
{ |
84 |
215 |
for (int i = 0; i < length; i++) |
85 |
|
{ |
86 |
215 |
if (operation[i] == M || operation[i] == D) |
87 |
|
{ |
88 |
163 |
p += range[i]; |
89 |
|
} |
90 |
215 |
if (operation[i] == M || operation[i] == I) |
91 |
|
{ |
92 |
215 |
ew = w + range[i]; |
93 |
215 |
if (column < ew) |
94 |
|
{ |
95 |
133 |
if (operation[i] == I) |
96 |
|
{ |
97 |
22 |
return -1; |
98 |
|
} |
99 |
111 |
return p - (ew - column); |
100 |
|
} |
101 |
82 |
w = ew; |
102 |
|
} |
103 |
|
} |
104 |
|
} |
105 |
0 |
return -1; |
106 |
|
} |
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
@return |
112 |
|
|
|
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
113 |
26 |
@Override... |
114 |
|
public String getSequenceString(char GapChar) |
115 |
|
{ |
116 |
26 |
return (length == 0) ? "" |
117 |
|
: (String) getSequenceAndDeletions( |
118 |
|
refseq.getSequenceAsString(start, end), GapChar)[0]; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
@return |
126 |
|
|
|
|
| 79.2% |
Uncovered Elements: 5 (24) |
Complexity: 6 |
Complexity Density: 0.38 |
|
127 |
172 |
public SequenceI getSeq(char GapChar)... |
128 |
|
{ |
129 |
172 |
Sequence seq; |
130 |
172 |
if (refseq == null || length == 0) |
131 |
|
{ |
132 |
0 |
return null; |
133 |
|
} |
134 |
172 |
Object[] edit_result = getSequenceAndDeletions( |
135 |
|
refseq.getSequenceAsString(start, end), GapChar); |
136 |
172 |
if (edit_result == null) |
137 |
|
{ |
138 |
0 |
throw new Error(MessageManager.getString( |
139 |
|
"error.implementation_error_unexpected_null_from_get_sequence_and_deletions")); |
140 |
|
} |
141 |
172 |
int bounds[] = (int[]) edit_result[1]; |
142 |
172 |
seq = new Sequence(refseq.getName(), (String) edit_result[0], |
143 |
|
refseq.getStart() + start + bounds[0], refseq.getStart() + start |
144 |
172 |
+ ((bounds[2] == 0) ? -1 : bounds[2])); |
145 |
172 |
seq.setDescription(refseq.getDescription()); |
146 |
172 |
int sstart = seq.getStart(), send = seq.getEnd(); |
147 |
|
|
148 |
|
|
149 |
172 |
if (seqProps != null) |
150 |
|
{ |
151 |
|
|
152 |
|
|
153 |
172 |
SeqsetUtils.SeqCharacterUnhash(seq, seqProps); |
154 |
|
} |
155 |
|
|
156 |
172 |
seq.setDatasetSequence(refseq); |
157 |
172 |
seq.setStart(sstart); |
158 |
172 |
seq.setEnd(send); |
159 |
172 |
return seq; |
160 |
|
} |
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
@param |
171 |
|
|
172 |
|
@param |
173 |
|
|
174 |
|
|
175 |
|
@param |
176 |
|
|
177 |
|
@param |
178 |
|
|
179 |
|
@return |
180 |
|
|
|
|
| 80.4% |
Uncovered Elements: 10 (51) |
Complexity: 12 |
Complexity Density: 0.36 |
|
181 |
136 |
private boolean _setSeq(SequenceI seq, boolean initialDeletion, int _s,... |
182 |
|
int _e) |
183 |
|
{ |
184 |
136 |
boolean hasgaps = false; |
185 |
136 |
if (seq == null) |
186 |
|
{ |
187 |
0 |
throw new Error(MessageManager |
188 |
|
.getString("error.implementation_error_set_seq_null")); |
189 |
|
} |
190 |
136 |
if (_s < 0) |
191 |
|
{ |
192 |
0 |
throw new Error(MessageManager |
193 |
|
.formatMessage("error.implementation_error_s", new String[] |
194 |
|
{ Integer.valueOf(_s).toString() })); |
195 |
|
} |
196 |
136 |
String seq_string = seq.getSequenceAsString(); |
197 |
136 |
if (_e == 0 || _e < _s || _e > seq_string.length()) |
198 |
|
{ |
199 |
10 |
_e = seq_string.length(); |
200 |
|
} |
201 |
|
|
202 |
136 |
start = seq.findPosition(_s) - seq.getStart(); |
203 |
136 |
end = seq.findPosition(_e) - seq.getStart(); |
204 |
136 |
int l_ungapped = end - start; |
205 |
|
|
206 |
|
|
207 |
136 |
SequenceI ds = seq.getDatasetSequence(); |
208 |
136 |
if (ds == null) |
209 |
|
{ |
210 |
|
|
211 |
17 |
String ungapped = AlignSeq.extractGaps( |
212 |
|
jalview.util.Comparison.GapChars, new String(seq_string)); |
213 |
17 |
l_ungapped = ungapped.length(); |
214 |
|
|
215 |
17 |
if (l_ungapped == seq.getLength()) |
216 |
|
{ |
217 |
16 |
ds = seq; |
218 |
|
} |
219 |
|
else |
220 |
|
{ |
221 |
1 |
ds = new Sequence(seq.getName(), ungapped, seq.getStart(), |
222 |
|
seq.getStart() + ungapped.length() - 1); |
223 |
|
|
224 |
|
|
225 |
|
} |
226 |
|
} |
227 |
|
|
228 |
136 |
if (ds.getStart() < seq.getStart()) |
229 |
|
{ |
230 |
14 |
int offset = seq.getStart() - ds.getStart(); |
231 |
14 |
if (initialDeletion) |
232 |
|
{ |
233 |
|
|
234 |
0 |
addDeleted(_s + offset); |
235 |
0 |
start = 0; |
236 |
0 |
end += offset; |
237 |
|
} |
238 |
|
else |
239 |
|
{ |
240 |
|
|
241 |
14 |
start += offset; |
242 |
14 |
end += offset; |
243 |
|
|
244 |
|
} |
245 |
|
|
246 |
|
} |
247 |
|
|
248 |
|
|
249 |
136 |
if (l_ungapped != (_e - _s)) |
250 |
|
{ |
251 |
106 |
hasgaps = true; |
252 |
|
} |
253 |
|
|
254 |
136 |
refseq = ds; |
255 |
|
|
256 |
136 |
seqProps = SeqsetUtils.SeqCharacterHash(seq); |
257 |
|
|
258 |
136 |
if (end > ds.getLength()) |
259 |
|
{ |
260 |
0 |
throw new Error(MessageManager |
261 |
|
.getString("error.implementation_error_seqcigar_possible")); |
262 |
|
|
263 |
|
} |
264 |
|
|
265 |
136 |
return hasgaps; |
266 |
|
} |
267 |
|
|
268 |
|
|
269 |
|
|
270 |
|
|
271 |
|
|
272 |
|
|
273 |
|
@param |
274 |
|
|
275 |
|
@param |
276 |
|
|
277 |
|
@param |
278 |
|
|
279 |
|
|
|
|
| 55.6% |
Uncovered Elements: 16 (36) |
Complexity: 10 |
Complexity Density: 0.45 |
|
280 |
1 |
public SeqCigar(SequenceI seq, char operation[], int range[])... |
281 |
|
{ |
282 |
1 |
super(); |
283 |
1 |
if (seq == null) |
284 |
|
{ |
285 |
0 |
throw new Error( |
286 |
|
MessageManager.getString("error.implmentation_bug_seq_null")); |
287 |
|
} |
288 |
1 |
if (operation.length != range.length) |
289 |
|
{ |
290 |
0 |
throw new Error(MessageManager.getString( |
291 |
|
"error.implementation_bug_cigar_operation_list_range_list")); |
292 |
|
} |
293 |
|
|
294 |
1 |
if (operation != null) |
295 |
|
{ |
296 |
1 |
this.operation = new char[operation.length + _inc_length]; |
297 |
1 |
this.range = new int[operation.length + _inc_length]; |
298 |
|
|
299 |
1 |
if (_setSeq(seq, false, 0, 0)) |
300 |
|
{ |
301 |
0 |
throw new Error(MessageManager.getString( |
302 |
|
"error.not_yet_implemented_cigar_object_from_cigar_string")); |
303 |
|
} |
304 |
11 |
for (int i = this.length, j = 0; j < operation.length; i++, j++) |
305 |
|
{ |
306 |
10 |
char op = operation[j]; |
307 |
10 |
if (op != M && op != I && op != D) |
308 |
|
{ |
309 |
0 |
throw new Error(MessageManager.formatMessage( |
310 |
|
"error.implementation_bug_cigar_operation", new String[] |
311 |
|
{ Integer.valueOf(j).toString(), |
312 |
|
Integer.valueOf(op).toString(), |
313 |
|
Integer.valueOf(M).toString(), |
314 |
|
Integer.valueOf(I).toString(), |
315 |
|
Integer.valueOf(D).toString() })); |
316 |
|
} |
317 |
10 |
this.operation[i] = op; |
318 |
10 |
this.range[i] = range[j]; |
319 |
|
} |
320 |
1 |
this.length += operation.length; |
321 |
|
} |
322 |
|
else |
323 |
|
{ |
324 |
0 |
this.operation = null; |
325 |
0 |
this.range = null; |
326 |
0 |
this.length = 0; |
327 |
0 |
if (_setSeq(seq, false, 0, 0)) |
328 |
|
{ |
329 |
0 |
throw new Error(MessageManager.getString( |
330 |
|
"error.not_yet_implemented_cigar_object_from_cigar_string")); |
331 |
|
} |
332 |
|
} |
333 |
|
} |
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
@param |
339 |
|
|
340 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
341 |
0 |
public void addMatch(int range)... |
342 |
|
{ |
343 |
0 |
this.addOperation(M, range); |
344 |
|
} |
345 |
|
|
346 |
|
|
347 |
|
|
348 |
|
|
349 |
|
|
350 |
|
@param |
351 |
|
|
352 |
|
@param |
353 |
|
|
354 |
|
@param |
355 |
|
|
356 |
|
@param |
357 |
|
|
358 |
|
@param |
359 |
|
|
360 |
|
|
361 |
|
|
|
|
| 70.8% |
Uncovered Elements: 14 (48) |
Complexity: 15 |
Complexity Density: 0.54 |
|
362 |
135 |
protected static void addSequenceOps(CigarBase cigar, SequenceI seq,... |
363 |
|
int startpos, int endpos, boolean initialDeletions) |
364 |
|
{ |
365 |
135 |
char op = '\0'; |
366 |
135 |
int range = 0; |
367 |
135 |
int p = 0, res = seq.getLength(); |
368 |
|
|
369 |
135 |
if (!initialDeletions) |
370 |
|
{ |
371 |
135 |
p = startpos; |
372 |
|
} |
373 |
|
|
374 |
13220 |
while (p <= endpos) |
375 |
|
{ |
376 |
13085 |
boolean isGap = (p < res) |
377 |
|
? jalview.util.Comparison.isGap(seq.getCharAt(p)) |
378 |
|
: true; |
379 |
13085 |
if ((startpos <= p) && (p <= endpos)) |
380 |
|
{ |
381 |
13085 |
if (isGap) |
382 |
|
{ |
383 |
1076 |
if (range > 0 && op != I) |
384 |
|
{ |
385 |
243 |
cigar.addOperation(op, range); |
386 |
243 |
range = 0; |
387 |
|
} |
388 |
1076 |
op = I; |
389 |
1076 |
range++; |
390 |
|
} |
391 |
|
else |
392 |
|
{ |
393 |
12009 |
if (range > 0 && op != M) |
394 |
|
{ |
395 |
223 |
cigar.addOperation(op, range); |
396 |
223 |
range = 0; |
397 |
|
} |
398 |
12009 |
op = M; |
399 |
12009 |
range++; |
400 |
|
} |
401 |
|
} |
402 |
|
else |
403 |
|
{ |
404 |
0 |
if (!isGap) |
405 |
|
{ |
406 |
0 |
if (range > 0 && op != D) |
407 |
|
{ |
408 |
0 |
cigar.addOperation(op, range); |
409 |
0 |
range = 0; |
410 |
|
} |
411 |
0 |
op = D; |
412 |
0 |
range++; |
413 |
|
} |
414 |
|
else |
415 |
|
{ |
416 |
|
|
417 |
|
} |
418 |
|
} |
419 |
13085 |
p++; |
420 |
|
} |
421 |
135 |
if (range > 0) |
422 |
|
{ |
423 |
135 |
cigar.addOperation(op, range); |
424 |
|
} |
425 |
|
} |
426 |
|
|
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
@param |
431 |
|
|
432 |
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
433 |
9 |
public SeqCigar(SequenceI seq)... |
434 |
|
{ |
435 |
9 |
super(); |
436 |
9 |
if (seq == null) |
437 |
|
{ |
438 |
0 |
throw new Error(MessageManager |
439 |
|
.getString("error.implementation_error_for_new_cigar")); |
440 |
|
} |
441 |
9 |
_setSeq(seq, false, 0, 0); |
442 |
|
|
443 |
9 |
addSequenceOps(this, seq, 0, seq.getLength() - 1, false); |
444 |
|
} |
445 |
|
|
446 |
|
|
447 |
|
|
448 |
|
|
449 |
|
@param |
450 |
|
|
451 |
|
@param |
452 |
|
|
453 |
|
@param |
454 |
|
|
455 |
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
456 |
126 |
public SeqCigar(SequenceI seq, int start, int end)... |
457 |
|
{ |
458 |
126 |
super(); |
459 |
126 |
if (seq == null) |
460 |
|
{ |
461 |
0 |
throw new Error(MessageManager |
462 |
|
.getString("error.implementation_error_for_new_cigar")); |
463 |
|
} |
464 |
126 |
_setSeq(seq, false, start, end + 1); |
465 |
|
|
466 |
126 |
addSequenceOps(this, seq, start, end, false); |
467 |
|
} |
468 |
|
|
469 |
|
|
470 |
|
|
471 |
|
|
472 |
|
|
473 |
|
|
474 |
|
@param |
475 |
|
|
476 |
|
@param |
477 |
|
|
478 |
|
@return |
479 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
480 |
1 |
public static SeqCigar parseCigar(SequenceI seq, String cigarString)... |
481 |
|
throws Exception |
482 |
|
{ |
483 |
1 |
Object[] opsandrange = parseCigarString(cigarString); |
484 |
1 |
return new SeqCigar(seq, (char[]) opsandrange[0], |
485 |
|
(int[]) opsandrange[1]); |
486 |
|
} |
487 |
|
|
488 |
|
|
489 |
|
|
490 |
|
|
491 |
|
|
492 |
|
|
493 |
|
@param |
494 |
|
@param |
495 |
|
@param |
496 |
|
|
497 |
|
@param |
498 |
|
|
499 |
|
@return |
500 |
|
|
|
|
| 87.1% |
Uncovered Elements: 9 (70) |
Complexity: 16 |
Complexity Density: 0.4 |
|
501 |
5 |
public static SequenceI[] createAlignmentSequences(SeqCigar[] alseqs,... |
502 |
|
char gapCharacter, HiddenColumns hidden, int[] segments) |
503 |
|
{ |
504 |
5 |
SequenceI[] seqs = new SequenceI[alseqs.length]; |
505 |
5 |
StringBuffer[] g_seqs = new StringBuffer[alseqs.length]; |
506 |
5 |
String[] alseqs_string = new String[alseqs.length]; |
507 |
5 |
Object[] gs_regions = new Object[alseqs.length]; |
508 |
15 |
for (int i = 0; i < alseqs.length; i++) |
509 |
|
{ |
510 |
10 |
alseqs_string[i] = alseqs[i].getRefSeq() |
511 |
|
.getSequenceAsString(alseqs[i].start, alseqs[i].end); |
512 |
10 |
gs_regions[i] = alseqs[i].getSequenceAndDeletions(alseqs_string[i], |
513 |
|
gapCharacter); |
514 |
|
|
515 |
10 |
if (gs_regions[i] == null) |
516 |
|
{ |
517 |
0 |
throw new Error(MessageManager.formatMessage( |
518 |
|
"error.implementation_error_cigar_seq_no_operations", |
519 |
|
new String[] |
520 |
|
{ Integer.valueOf(i).toString() })); |
521 |
|
} |
522 |
10 |
g_seqs[i] = new StringBuffer((String) ((Object[]) gs_regions[i])[0]); |
523 |
|
|
524 |
|
|
525 |
|
|
526 |
|
} |
527 |
|
|
528 |
|
|
529 |
|
|
530 |
5 |
ShiftList shifts = new ShiftList(); |
531 |
15 |
for (int i = 0; i < alseqs.length; i++) |
532 |
|
{ |
533 |
10 |
Object[] gs_region = ((Object[]) ((Object[]) gs_regions[i])[2]); |
534 |
10 |
if (gs_region != null) |
535 |
|
|
536 |
|
{ |
537 |
2 |
for (int hr = 0; hr < gs_region.length; hr++) |
538 |
|
{ |
539 |
1 |
int[] region = (int[]) gs_region[hr]; |
540 |
1 |
char[] insert = new char[region[1] - region[0] + 1]; |
541 |
7 |
for (int s = 0; s < insert.length; s++) |
542 |
|
{ |
543 |
6 |
insert[s] = gapCharacter; |
544 |
|
} |
545 |
1 |
int inspos = shifts.shift(region[2]); |
546 |
|
|
547 |
|
|
548 |
4 |
for (int s = 0; s < alseqs.length; s++) |
549 |
|
{ |
550 |
3 |
if (s != i) |
551 |
|
{ |
552 |
2 |
if (g_seqs[s].length() <= inspos) |
553 |
|
{ |
554 |
|
|
555 |
0 |
for (int l = inspos - g_seqs[s].length(); l > 0; l--) |
556 |
|
{ |
557 |
0 |
g_seqs[s].append(gapCharacter); |
558 |
|
|
559 |
|
} |
560 |
|
} |
561 |
2 |
g_seqs[s].insert(inspos, insert); |
562 |
|
} |
563 |
|
else |
564 |
|
{ |
565 |
1 |
g_seqs[s].insert(inspos, |
566 |
|
alseqs_string[i].substring(region[0], region[1] + 1)); |
567 |
|
} |
568 |
|
} |
569 |
1 |
shifts.addShift(region[2], insert.length); |
570 |
|
|
571 |
|
|
572 |
1 |
if (segments == null) |
573 |
|
{ |
574 |
|
|
575 |
1 |
hidden.hideColumns(inspos, inspos + insert.length - 1); |
576 |
|
} |
577 |
|
} |
578 |
|
} |
579 |
|
} |
580 |
15 |
for (int i = 0; i < alseqs.length; i++) |
581 |
|
{ |
582 |
10 |
int[] bounds = ((int[]) ((Object[]) gs_regions[i])[1]); |
583 |
10 |
SequenceI ref = alseqs[i].getRefSeq(); |
584 |
10 |
seqs[i] = new Sequence(ref.getName(), g_seqs[i].toString(), |
585 |
|
ref.getStart() + alseqs[i].start + bounds[0], |
586 |
|
ref.getStart() + alseqs[i].start |
587 |
10 |
+ (bounds[2] == 0 ? -1 : bounds[2])); |
588 |
10 |
seqs[i].setDatasetSequence(ref); |
589 |
10 |
seqs[i].setDescription(ref.getDescription()); |
590 |
|
} |
591 |
5 |
if (segments != null) |
592 |
|
{ |
593 |
4 |
for (int i = 0; i < segments.length; i += 3) |
594 |
|
{ |
595 |
|
|
596 |
|
|
597 |
2 |
hidden.hideColumns(segments[i + 1], |
598 |
|
segments[i + 1] + segments[i + 2] - 1); |
599 |
|
} |
600 |
|
} |
601 |
5 |
return seqs; |
602 |
|
} |
603 |
|
|
604 |
|
|
605 |
|
|
606 |
|
|
607 |
|
private Hashtable selGroups = null; |
608 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
609 |
33 |
public void setGroupMembership(Object group)... |
610 |
|
{ |
611 |
33 |
if (selGroups == null) |
612 |
|
{ |
613 |
33 |
selGroups = new Hashtable(); |
614 |
|
} |
615 |
33 |
selGroups.put(group, new int[0]); |
616 |
|
} |
617 |
|
|
618 |
|
|
619 |
|
|
620 |
|
|
621 |
|
@param |
622 |
|
@return |
623 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
624 |
0 |
public boolean removeGroupMembership(Object group)... |
625 |
|
{ |
626 |
0 |
if (selGroups != null && selGroups.containsKey(group)) |
627 |
|
{ |
628 |
0 |
selGroups.remove(group); |
629 |
0 |
return true; |
630 |
|
} |
631 |
0 |
return false; |
632 |
|
} |
633 |
|
|
634 |
|
|
635 |
|
|
636 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
637 |
0 |
public void clearMemberships()... |
638 |
|
{ |
639 |
0 |
if (selGroups != null) |
640 |
|
{ |
641 |
0 |
selGroups.clear(); |
642 |
|
} |
643 |
0 |
selGroups = null; |
644 |
|
} |
645 |
|
|
646 |
|
|
647 |
|
|
648 |
|
@return |
649 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
650 |
0 |
public Object[] getAllMemberships()... |
651 |
|
{ |
652 |
0 |
if (selGroups == null) |
653 |
|
{ |
654 |
0 |
return null; |
655 |
|
} |
656 |
0 |
Object[] mmbs = new Object[selGroups.size()]; |
657 |
0 |
Enumeration en = selGroups.keys(); |
658 |
0 |
for (int i = 0; en.hasMoreElements(); i++) |
659 |
|
{ |
660 |
0 |
mmbs[i] = en.nextElement(); |
661 |
|
} |
662 |
0 |
return mmbs; |
663 |
|
} |
664 |
|
|
665 |
|
|
666 |
|
|
667 |
|
|
668 |
|
@param |
669 |
|
|
670 |
|
|
671 |
|
@return |
672 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
673 |
363 |
public boolean isMemberOf(Object sgr)... |
674 |
|
{ |
675 |
363 |
return (selGroups != null) && selGroups.get(sgr) != null; |
676 |
|
} |
677 |
|
} |