1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
package jalview.binding; |
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
import org.exolab.castor.xml.Marshaller; |
15 |
|
import org.exolab.castor.xml.Unmarshaller; |
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
@version |
21 |
|
|
|
|
| 0% |
Uncovered Elements: 73 (73) |
Complexity: 30 |
Complexity Density: 0.73 |
|
22 |
|
public class CompoundMatcher implements java.io.Serializable |
23 |
|
{ |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
private boolean _and; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
private boolean _has_and; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
private java.util.Vector _matcherSetList; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
48 |
0 |
public CompoundMatcher()... |
49 |
|
{ |
50 |
0 |
super(); |
51 |
0 |
this._matcherSetList = new java.util.Vector(); |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
@param |
62 |
|
@throws |
63 |
|
|
64 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
65 |
0 |
public void addMatcherSet(final jalview.binding.MatcherSet vMatcherSet)... |
66 |
|
throws java.lang.IndexOutOfBoundsException |
67 |
|
{ |
68 |
|
|
69 |
0 |
if (this._matcherSetList.size() >= 2) |
70 |
|
{ |
71 |
0 |
throw new IndexOutOfBoundsException( |
72 |
|
"addMatcherSet has a maximum of 2"); |
73 |
|
} |
74 |
|
|
75 |
0 |
this._matcherSetList.addElement(vMatcherSet); |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
@param |
82 |
|
@param |
83 |
|
@throws |
84 |
|
|
85 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
86 |
0 |
public void addMatcherSet(final int index,... |
87 |
|
final jalview.binding.MatcherSet vMatcherSet) |
88 |
|
throws java.lang.IndexOutOfBoundsException |
89 |
|
{ |
90 |
|
|
91 |
0 |
if (this._matcherSetList.size() >= 2) |
92 |
|
{ |
93 |
0 |
throw new IndexOutOfBoundsException( |
94 |
|
"addMatcherSet has a maximum of 2"); |
95 |
|
} |
96 |
|
|
97 |
0 |
this._matcherSetList.add(index, vMatcherSet); |
98 |
|
} |
99 |
|
|
100 |
|
|
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0 |
public void deleteAnd()... |
103 |
|
{ |
104 |
0 |
this._has_and = false; |
105 |
|
} |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
@return |
111 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
0 |
public java.util.Enumeration enumerateMatcherSet()... |
113 |
|
{ |
114 |
0 |
return this._matcherSetList.elements(); |
115 |
|
} |
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
@return |
122 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
0 |
public boolean getAnd()... |
124 |
|
{ |
125 |
0 |
return this._and; |
126 |
|
} |
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
@param |
132 |
|
@throws |
133 |
|
|
134 |
|
@return |
135 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
136 |
0 |
public jalview.binding.MatcherSet getMatcherSet(final int index)... |
137 |
|
throws java.lang.IndexOutOfBoundsException |
138 |
|
{ |
139 |
|
|
140 |
0 |
if (index < 0 || index >= this._matcherSetList.size()) |
141 |
|
{ |
142 |
0 |
throw new IndexOutOfBoundsException( |
143 |
|
"getMatcherSet: Index value '" + index + "' not in range [0.." |
144 |
|
+ (this._matcherSetList.size() - 1) + "]"); |
145 |
|
} |
146 |
|
|
147 |
0 |
return (jalview.binding.MatcherSet) _matcherSetList.get(index); |
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
@return |
158 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
159 |
0 |
public jalview.binding.MatcherSet[] getMatcherSet()... |
160 |
|
{ |
161 |
0 |
jalview.binding.MatcherSet[] array = new jalview.binding.MatcherSet[0]; |
162 |
0 |
return (jalview.binding.MatcherSet[]) this._matcherSetList |
163 |
|
.toArray(array); |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
@return |
170 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
171 |
0 |
public int getMatcherSetCount()... |
172 |
|
{ |
173 |
0 |
return this._matcherSetList.size(); |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
@return |
180 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
181 |
0 |
public boolean hasAnd()... |
182 |
|
{ |
183 |
0 |
return this._has_and; |
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
|
@return |
191 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
192 |
0 |
public boolean isAnd()... |
193 |
|
{ |
194 |
0 |
return this._and; |
195 |
|
} |
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
|
200 |
|
@return |
201 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
202 |
0 |
public boolean isValid()... |
203 |
|
{ |
204 |
0 |
try |
205 |
|
{ |
206 |
0 |
validate(); |
207 |
|
} catch (org.exolab.castor.xml.ValidationException vex) |
208 |
|
{ |
209 |
0 |
return false; |
210 |
|
} |
211 |
0 |
return true; |
212 |
|
} |
213 |
|
|
214 |
|
|
215 |
|
|
216 |
|
|
217 |
|
@param |
218 |
|
@throws |
219 |
|
|
220 |
|
|
221 |
|
@throws |
222 |
|
|
223 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
224 |
0 |
public void marshal(final java.io.Writer out)... |
225 |
|
throws org.exolab.castor.xml.MarshalException, |
226 |
|
org.exolab.castor.xml.ValidationException |
227 |
|
{ |
228 |
0 |
Marshaller.marshal(this, out); |
229 |
|
} |
230 |
|
|
231 |
|
|
232 |
|
|
233 |
|
|
234 |
|
@param |
235 |
|
@throws |
236 |
|
|
237 |
|
@throws |
238 |
|
|
239 |
|
@throws |
240 |
|
|
241 |
|
|
242 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
243 |
0 |
public void marshal(final org.xml.sax.ContentHandler handler)... |
244 |
|
throws java.io.IOException, |
245 |
|
org.exolab.castor.xml.MarshalException, |
246 |
|
org.exolab.castor.xml.ValidationException |
247 |
|
{ |
248 |
0 |
Marshaller.marshal(this, handler); |
249 |
|
} |
250 |
|
|
251 |
|
|
252 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
253 |
0 |
public void removeAllMatcherSet()... |
254 |
|
{ |
255 |
0 |
this._matcherSetList.clear(); |
256 |
|
} |
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
@param |
262 |
|
@return |
263 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
264 |
0 |
public boolean removeMatcherSet(... |
265 |
|
final jalview.binding.MatcherSet vMatcherSet) |
266 |
|
{ |
267 |
0 |
boolean removed = _matcherSetList.remove(vMatcherSet); |
268 |
0 |
return removed; |
269 |
|
} |
270 |
|
|
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
@param |
275 |
|
@return |
276 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
277 |
0 |
public jalview.binding.MatcherSet removeMatcherSetAt(final int index)... |
278 |
|
{ |
279 |
0 |
java.lang.Object obj = this._matcherSetList.remove(index); |
280 |
0 |
return (jalview.binding.MatcherSet) obj; |
281 |
|
} |
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
|
|
287 |
|
@param |
288 |
|
|
289 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
290 |
0 |
public void setAnd(final boolean and)... |
291 |
|
{ |
292 |
0 |
this._and = and; |
293 |
0 |
this._has_and = true; |
294 |
|
} |
295 |
|
|
296 |
|
|
297 |
|
|
298 |
|
|
299 |
|
@param |
300 |
|
@param |
301 |
|
@throws |
302 |
|
|
303 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
304 |
0 |
public void setMatcherSet(final int index,... |
305 |
|
final jalview.binding.MatcherSet vMatcherSet) |
306 |
|
throws java.lang.IndexOutOfBoundsException |
307 |
|
{ |
308 |
|
|
309 |
0 |
if (index < 0 || index >= this._matcherSetList.size()) |
310 |
|
{ |
311 |
0 |
throw new IndexOutOfBoundsException( |
312 |
|
"setMatcherSet: Index value '" + index + "' not in range [0.." |
313 |
|
+ (this._matcherSetList.size() - 1) + "]"); |
314 |
|
} |
315 |
|
|
316 |
0 |
this._matcherSetList.set(index, vMatcherSet); |
317 |
|
} |
318 |
|
|
319 |
|
|
320 |
|
|
321 |
|
|
322 |
|
@param |
323 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
324 |
0 |
public void setMatcherSet(... |
325 |
|
final jalview.binding.MatcherSet[] vMatcherSetArray) |
326 |
|
{ |
327 |
|
|
328 |
0 |
_matcherSetList.clear(); |
329 |
|
|
330 |
0 |
for (int i = 0; i < vMatcherSetArray.length; i++) |
331 |
|
{ |
332 |
0 |
this._matcherSetList.add(vMatcherSetArray[i]); |
333 |
|
} |
334 |
|
} |
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
|
339 |
|
@param |
340 |
|
@throws |
341 |
|
|
342 |
|
|
343 |
|
@throws |
344 |
|
|
345 |
|
@return |
346 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
347 |
0 |
public static jalview.binding.CompoundMatcher unmarshal(... |
348 |
|
final java.io.Reader reader) |
349 |
|
throws org.exolab.castor.xml.MarshalException, |
350 |
|
org.exolab.castor.xml.ValidationException |
351 |
|
{ |
352 |
0 |
return (jalview.binding.CompoundMatcher) Unmarshaller |
353 |
|
.unmarshal(jalview.binding.CompoundMatcher.class, reader); |
354 |
|
} |
355 |
|
|
356 |
|
|
357 |
|
|
358 |
|
|
359 |
|
@throws |
360 |
|
|
361 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
362 |
0 |
public void validate() throws org.exolab.castor.xml.ValidationException... |
363 |
|
{ |
364 |
0 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); |
365 |
0 |
validator.validate(this); |
366 |
|
} |
367 |
|
|
368 |
|
} |