Clover icon

jalviewX

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

File FeatureSettings.java

 

Coverage histogram

../../../img/srcFileCovDistChart3.png
47% of files have more coverage

Code metrics

12
52
28
1
462
197
39
0.75
1.86
28
1.39

Classes

Class Line # Actions
FeatureSettings 22 52 39 66
0.282608728.3%
 

Contributing tests

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