Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.schemabinding.version2

File VAMSAS.java

 

Coverage histogram

../../../img/srcFileCovDistChart2.png
51% of files have more coverage

Code metrics

12
52
28
1
454
191
39
0.75
1.86
28
1.39

Classes

Class Line # Actions
VAMSAS 22 52 39 76
0.1739130517.4%
 

Contributing tests

This file is covered by 16 tests. .

Source view

1    /*
2    * This class was automatically generated with
3    * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8    package jalview.schemabinding.version2;
9   
10    //---------------------------------/
11    //- Imported classes and packages -/
12    //---------------------------------/
13   
14    import org.exolab.castor.xml.Marshaller;
15    import org.exolab.castor.xml.Unmarshaller;
16   
17    /**
18    * Class VAMSAS.
19    *
20    * @version $Revision$ $Date$
21    */
 
22    public class VAMSAS implements java.io.Serializable
23    {
24   
25    // --------------------------/
26    // - Class/Member Variables -/
27    // --------------------------/
28   
29    /**
30    * Field _treeList.
31    */
32    private java.util.Vector _treeList;
33   
34    /**
35    * Field _sequenceSetList.
36    */
37    private java.util.Vector _sequenceSetList;
38   
39    // ----------------/
40    // - Constructors -/
41    // ----------------/
42   
 
43  115 toggle public VAMSAS()
44    {
45  115 super();
46  115 this._treeList = new java.util.Vector();
47  115 this._sequenceSetList = new java.util.Vector();
48    }
49   
50    // -----------/
51    // - Methods -/
52    // -----------/
53   
54    /**
55    *
56    *
57    * @param vSequenceSet
58    * @throws java.lang.IndexOutOfBoundsException
59    * if the index given is outside the bounds of the collection
60    */
 
61  115 toggle public void addSequenceSet(
62    final jalview.schemabinding.version2.SequenceSet vSequenceSet)
63    throws java.lang.IndexOutOfBoundsException
64    {
65  115 this._sequenceSetList.addElement(vSequenceSet);
66    }
67   
68    /**
69    *
70    *
71    * @param index
72    * @param vSequenceSet
73    * @throws java.lang.IndexOutOfBoundsException
74    * if the index given is outside the bounds of the collection
75    */
 
76  0 toggle public void addSequenceSet(final int index,
77    final jalview.schemabinding.version2.SequenceSet vSequenceSet)
78    throws java.lang.IndexOutOfBoundsException
79    {
80  0 this._sequenceSetList.add(index, vSequenceSet);
81    }
82   
83    /**
84    *
85    *
86    * @param vTree
87    * @throws java.lang.IndexOutOfBoundsException
88    * if the index given is outside the bounds of the collection
89    */
 
90  0 toggle public void addTree(final java.lang.String vTree)
91    throws java.lang.IndexOutOfBoundsException
92    {
93  0 this._treeList.addElement(vTree);
94    }
95   
96    /**
97    *
98    *
99    * @param index
100    * @param vTree
101    * @throws java.lang.IndexOutOfBoundsException
102    * if the index given is outside the bounds of the collection
103    */
 
104  0 toggle public void addTree(final int index, final java.lang.String vTree)
105    throws java.lang.IndexOutOfBoundsException
106    {
107  0 this._treeList.add(index, vTree);
108    }
109   
110    /**
111    * Method enumerateSequenceSet.
112    *
113    * @return an Enumeration over all jalview.schemabinding.version2.SequenceSet
114    * elements
115    */
 
116  0 toggle public java.util.Enumeration enumerateSequenceSet()
117    {
118  0 return this._sequenceSetList.elements();
119    }
120   
121    /**
122    * Method enumerateTree.
123    *
124    * @return an Enumeration over all java.lang.String elements
125    */
 
126  0 toggle public java.util.Enumeration enumerateTree()
127    {
128  0 return this._treeList.elements();
129    }
130   
131    /**
132    * Method getSequenceSet.
133    *
134    * @param index
135    * @throws java.lang.IndexOutOfBoundsException
136    * if the index given is outside the bounds of the collection
137    * @return the value of the jalview.schemabinding.version2.SequenceSet at the
138    * given index
139    */
 
140  82 toggle public jalview.schemabinding.version2.SequenceSet getSequenceSet(
141    final int index) throws java.lang.IndexOutOfBoundsException
142    {
143    // check bounds for index
144  82 if (index < 0 || index >= this._sequenceSetList.size())
145    {
146  0 throw new IndexOutOfBoundsException("getSequenceSet: Index value '"
147    + index + "' not in range [0.."
148    + (this._sequenceSetList.size() - 1) + "]");
149    }
150   
151  82 return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList
152    .get(index);
153    }
154   
155    /**
156    * Method getSequenceSet.Returns the contents of the collection in an Array.
157    * <p>
158    * Note: Just in case the collection contents are changing in another thread,
159    * we pass a 0-length Array of the correct type into the API call. This way we
160    * <i>know</i> that the Array returned is of exactly the correct length.
161    *
162    * @return this collection as an Array
163    */
 
164  58 toggle public jalview.schemabinding.version2.SequenceSet[] getSequenceSet()
165    {
166  58 jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0];
167  58 return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList
168    .toArray(array);
169    }
170   
171    /**
172    * Method getSequenceSetCount.
173    *
174    * @return the size of this collection
175    */
 
176  0 toggle public int getSequenceSetCount()
177    {
178  0 return this._sequenceSetList.size();
179    }
180   
181    /**
182    * Method getTree.
183    *
184    * @param index
185    * @throws java.lang.IndexOutOfBoundsException
186    * if the index given is outside the bounds of the collection
187    * @return the value of the java.lang.String at the given index
188    */
 
189  0 toggle public java.lang.String getTree(final int index)
190    throws java.lang.IndexOutOfBoundsException
191    {
192    // check bounds for index
193  0 if (index < 0 || index >= this._treeList.size())
194    {
195  0 throw new IndexOutOfBoundsException("getTree: Index value '" + index
196    + "' not in range [0.." + (this._treeList.size() - 1) + "]");
197    }
198   
199  0 return (java.lang.String) _treeList.get(index);
200    }
201   
202    /**
203    * Method getTree.Returns the contents of the collection in an Array.
204    * <p>
205    * Note: Just in case the collection contents are changing in another thread,
206    * we pass a 0-length Array of the correct type into the API call. This way we
207    * <i>know</i> that the Array returned is of exactly the correct length.
208    *
209    * @return this collection as an Array
210    */
 
211  58 toggle public java.lang.String[] getTree()
212    {
213  58 java.lang.String[] array = new java.lang.String[0];
214  58 return (java.lang.String[]) this._treeList.toArray(array);
215    }
216   
217    /**
218    * Method getTreeCount.
219    *
220    * @return the size of this collection
221    */
 
222  0 toggle public int getTreeCount()
223    {
224  0 return this._treeList.size();
225    }
226   
227    /**
228    * Method isValid.
229    *
230    * @return true if this object is valid according to the schema
231    */
 
232  0 toggle public boolean isValid()
233    {
234  0 try
235    {
236  0 validate();
237    } catch (org.exolab.castor.xml.ValidationException vex)
238    {
239  0 return false;
240    }
241  0 return true;
242    }
243   
244    /**
245    *
246    *
247    * @param out
248    * @throws org.exolab.castor.xml.MarshalException
249    * if object is null or if any SAXException is thrown during
250    * marshaling
251    * @throws org.exolab.castor.xml.ValidationException
252    * if this object is an invalid instance according to the schema
253    */
 
254  0 toggle public void marshal(final java.io.Writer out)
255    throws org.exolab.castor.xml.MarshalException,
256    org.exolab.castor.xml.ValidationException
257    {
258  0 Marshaller.marshal(this, out);
259    }
260   
261    /**
262    *
263    *
264    * @param handler
265    * @throws java.io.IOException
266    * if an IOException occurs during marshaling
267    * @throws org.exolab.castor.xml.ValidationException
268    * if this object is an invalid instance according to the schema
269    * @throws org.exolab.castor.xml.MarshalException
270    * if object is null or if any SAXException is thrown during
271    * marshaling
272    */
 
273  0 toggle public void marshal(final org.xml.sax.ContentHandler handler)
274    throws java.io.IOException,
275    org.exolab.castor.xml.MarshalException,
276    org.exolab.castor.xml.ValidationException
277    {
278  0 Marshaller.marshal(this, handler);
279    }
280   
281    /**
282    */
 
283  0 toggle public void removeAllSequenceSet()
284    {
285  0 this._sequenceSetList.clear();
286    }
287   
288    /**
289    */
 
290  0 toggle public void removeAllTree()
291    {
292  0 this._treeList.clear();
293    }
294   
295    /**
296    * Method removeSequenceSet.
297    *
298    * @param vSequenceSet
299    * @return true if the object was removed from the collection.
300    */
 
301  0 toggle public boolean removeSequenceSet(
302    final jalview.schemabinding.version2.SequenceSet vSequenceSet)
303    {
304  0 boolean removed = _sequenceSetList.remove(vSequenceSet);
305  0 return removed;
306    }
307   
308    /**
309    * Method removeSequenceSetAt.
310    *
311    * @param index
312    * @return the element removed from the collection
313    */
 
314  0 toggle public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt(
315    final int index)
316    {
317  0 java.lang.Object obj = this._sequenceSetList.remove(index);
318  0 return (jalview.schemabinding.version2.SequenceSet) obj;
319    }
320   
321    /**
322    * Method removeTree.
323    *
324    * @param vTree
325    * @return true if the object was removed from the collection.
326    */
 
327  0 toggle public boolean removeTree(final java.lang.String vTree)
328    {
329  0 boolean removed = _treeList.remove(vTree);
330  0 return removed;
331    }
332   
333    /**
334    * Method removeTreeAt.
335    *
336    * @param index
337    * @return the element removed from the collection
338    */
 
339  0 toggle public java.lang.String removeTreeAt(final int index)
340    {
341  0 java.lang.Object obj = this._treeList.remove(index);
342  0 return (java.lang.String) obj;
343    }
344   
345    /**
346    *
347    *
348    * @param index
349    * @param vSequenceSet
350    * @throws java.lang.IndexOutOfBoundsException
351    * if the index given is outside the bounds of the collection
352    */
 
353  0 toggle public void setSequenceSet(final int index,
354    final jalview.schemabinding.version2.SequenceSet vSequenceSet)
355    throws java.lang.IndexOutOfBoundsException
356    {
357    // check bounds for index
358  0 if (index < 0 || index >= this._sequenceSetList.size())
359    {
360  0 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"
361    + index + "' not in range [0.."
362    + (this._sequenceSetList.size() - 1) + "]");
363    }
364   
365  0 this._sequenceSetList.set(index, vSequenceSet);
366    }
367   
368    /**
369    *
370    *
371    * @param vSequenceSetArray
372    */
 
373  0 toggle public void setSequenceSet(
374    final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray)
375    {
376    // -- copy array
377  0 _sequenceSetList.clear();
378   
379  0 for (int i = 0; i < vSequenceSetArray.length; i++)
380    {
381  0 this._sequenceSetList.add(vSequenceSetArray[i]);
382    }
383    }
384   
385    /**
386    *
387    *
388    * @param index
389    * @param vTree
390    * @throws java.lang.IndexOutOfBoundsException
391    * if the index given is outside the bounds of the collection
392    */
 
393  0 toggle public void setTree(final int index, final java.lang.String vTree)
394    throws java.lang.IndexOutOfBoundsException
395    {
396    // check bounds for index
397  0 if (index < 0 || index >= this._treeList.size())
398    {
399  0 throw new IndexOutOfBoundsException("setTree: Index value '" + index
400    + "' not in range [0.." + (this._treeList.size() - 1) + "]");
401    }
402   
403  0 this._treeList.set(index, vTree);
404    }
405   
406    /**
407    *
408    *
409    * @param vTreeArray
410    */
 
411  0 toggle public void setTree(final java.lang.String[] vTreeArray)
412    {
413    // -- copy array
414  0 _treeList.clear();
415   
416  0 for (int i = 0; i < vTreeArray.length; i++)
417    {
418  0 this._treeList.add(vTreeArray[i]);
419    }
420    }
421   
422    /**
423    * Method unmarshal.
424    *
425    * @param reader
426    * @throws org.exolab.castor.xml.MarshalException
427    * if object is null or if any SAXException is thrown during
428    * marshaling
429    * @throws org.exolab.castor.xml.ValidationException
430    * if this object is an invalid instance according to the schema
431    * @return the unmarshaled jalview.schemabinding.version2.VAMSAS
432    */
 
433  0 toggle public static jalview.schemabinding.version2.VAMSAS unmarshal(
434    final java.io.Reader reader)
435    throws org.exolab.castor.xml.MarshalException,
436    org.exolab.castor.xml.ValidationException
437    {
438  0 return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(
439    jalview.schemabinding.version2.VAMSAS.class, reader);
440    }
441   
442    /**
443    *
444    *
445    * @throws org.exolab.castor.xml.ValidationException
446    * if this object is an invalid instance according to the schema
447    */
 
448  0 toggle public void validate() throws org.exolab.castor.xml.ValidationException
449    {
450  0 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
451  0 validator.validate(this);
452    }
453   
454    }