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