Clover icon

jalviewX

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

File MapListType.java

 

Coverage histogram

../../../img/srcFileCovDistChart0.png
56% of files have more coverage

Code metrics

12
62
36
1
597
240
47
0.76
1.72
36
1.31

Classes

Class Line # Actions
MapListType 26 62 47 110
0.00%
 

Contributing tests

No tests hitting this source file were found.

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    * developed after mapRangeType from
19    * http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes
20    *
21    * This effectively represents a java.util.MapList object
22    *
23    *
24    * @version $Revision$ $Date$
25    */
 
26    public class MapListType implements java.io.Serializable
27    {
28   
29    // --------------------------/
30    // - Class/Member Variables -/
31    // --------------------------/
32   
33    /**
34    * number of dictionary symbol widths involved in each mapped position on this
35    * sequence (for example, 3 for a dna sequence exon region that is being
36    * mapped to a protein sequence). This is optional, since the unit can be
37    * usually be inferred from the dictionary type of each sequence involved in
38    * the mapping.
39    */
40    private long _mapFromUnit;
41   
42    /**
43    * keeps track of state for field: _mapFromUnit
44    */
45    private boolean _has_mapFromUnit;
46   
47    /**
48    * number of dictionary symbol widths involved in each mapped position on this
49    * sequence (for example, 3 for a dna sequence exon region that is being
50    * mapped to a protein sequence). This is optional, since the unit can be
51    * usually be inferred from the dictionary type of each sequence involved in
52    * the mapping.
53    */
54    private long _mapToUnit;
55   
56    /**
57    * keeps track of state for field: _mapToUnit
58    */
59    private boolean _has_mapToUnit;
60   
61    /**
62    * a region from start to end inclusive
63    */
64    private java.util.Vector _mapListFromList;
65   
66    /**
67    * a region from start to end inclusive
68    */
69    private java.util.Vector _mapListToList;
70   
71    // ----------------/
72    // - Constructors -/
73    // ----------------/
74   
 
75  0 toggle public MapListType()
76    {
77  0 super();
78  0 this._mapListFromList = new java.util.Vector();
79  0 this._mapListToList = new java.util.Vector();
80    }
81   
82    // -----------/
83    // - Methods -/
84    // -----------/
85   
86    /**
87    *
88    *
89    * @param vMapListFrom
90    * @throws java.lang.IndexOutOfBoundsException
91    * if the index given is outside the bounds of the collection
92    */
 
93  0 toggle public void addMapListFrom(
94    final jalview.schemabinding.version2.MapListFrom vMapListFrom)
95    throws java.lang.IndexOutOfBoundsException
96    {
97  0 this._mapListFromList.addElement(vMapListFrom);
98    }
99   
100    /**
101    *
102    *
103    * @param index
104    * @param vMapListFrom
105    * @throws java.lang.IndexOutOfBoundsException
106    * if the index given is outside the bounds of the collection
107    */
 
108  0 toggle public void addMapListFrom(final int index,
109    final jalview.schemabinding.version2.MapListFrom vMapListFrom)
110    throws java.lang.IndexOutOfBoundsException
111    {
112  0 this._mapListFromList.add(index, vMapListFrom);
113    }
114   
115    /**
116    *
117    *
118    * @param vMapListTo
119    * @throws java.lang.IndexOutOfBoundsException
120    * if the index given is outside the bounds of the collection
121    */
 
122  0 toggle public void addMapListTo(
123    final jalview.schemabinding.version2.MapListTo vMapListTo)
124    throws java.lang.IndexOutOfBoundsException
125    {
126  0 this._mapListToList.addElement(vMapListTo);
127    }
128   
129    /**
130    *
131    *
132    * @param index
133    * @param vMapListTo
134    * @throws java.lang.IndexOutOfBoundsException
135    * if the index given is outside the bounds of the collection
136    */
 
137  0 toggle public void addMapListTo(final int index,
138    final jalview.schemabinding.version2.MapListTo vMapListTo)
139    throws java.lang.IndexOutOfBoundsException
140    {
141  0 this._mapListToList.add(index, vMapListTo);
142    }
143   
144    /**
145    */
 
146  0 toggle public void deleteMapFromUnit()
147    {
148  0 this._has_mapFromUnit = false;
149    }
150   
151    /**
152    */
 
153  0 toggle public void deleteMapToUnit()
154    {
155  0 this._has_mapToUnit = false;
156    }
157   
158    /**
159    * Method enumerateMapListFrom.
160    *
161    * @return an Enumeration over all jalview.schemabinding.version2.MapListFrom
162    * elements
163    */
 
164  0 toggle public java.util.Enumeration enumerateMapListFrom()
165    {
166  0 return this._mapListFromList.elements();
167    }
168   
169    /**
170    * Method enumerateMapListTo.
171    *
172    * @return an Enumeration over all jalview.schemabinding.version2.MapListTo
173    * elements
174    */
 
175  0 toggle public java.util.Enumeration enumerateMapListTo()
176    {
177  0 return this._mapListToList.elements();
178    }
179   
180    /**
181    * Returns the value of field 'mapFromUnit'. The field 'mapFromUnit' has the
182    * following description: number of dictionary symbol widths involved in each
183    * mapped position on this sequence (for example, 3 for a dna sequence exon
184    * region that is being mapped to a protein sequence). This is optional, since
185    * the unit can be usually be inferred from the dictionary type of each
186    * sequence involved in the mapping.
187    *
188    * @return the value of field 'MapFromUnit'.
189    */
 
190  0 toggle public long getMapFromUnit()
191    {
192  0 return this._mapFromUnit;
193    }
194   
195    /**
196    * Method getMapListFrom.
197    *
198    * @param index
199    * @throws java.lang.IndexOutOfBoundsException
200    * if the index given is outside the bounds of the collection
201    * @return the value of the jalview.schemabinding.version2.MapListFrom at the
202    * given index
203    */
 
204  0 toggle public jalview.schemabinding.version2.MapListFrom getMapListFrom(
205    final int index) throws java.lang.IndexOutOfBoundsException
206    {
207    // check bounds for index
208  0 if (index < 0 || index >= this._mapListFromList.size())
209    {
210  0 throw new IndexOutOfBoundsException("getMapListFrom: Index value '"
211    + index + "' not in range [0.."
212    + (this._mapListFromList.size() - 1) + "]");
213    }
214   
215  0 return (jalview.schemabinding.version2.MapListFrom) _mapListFromList
216    .get(index);
217    }
218   
219    /**
220    * Method getMapListFrom.Returns the contents of the collection in an Array.
221    * <p>
222    * Note: Just in case the collection contents are changing in another thread,
223    * we pass a 0-length Array of the correct type into the API call. This way we
224    * <i>know</i> that the Array returned is of exactly the correct length.
225    *
226    * @return this collection as an Array
227    */
 
228  0 toggle public jalview.schemabinding.version2.MapListFrom[] getMapListFrom()
229    {
230  0 jalview.schemabinding.version2.MapListFrom[] array = new jalview.schemabinding.version2.MapListFrom[0];
231  0 return (jalview.schemabinding.version2.MapListFrom[]) this._mapListFromList
232    .toArray(array);
233    }
234   
235    /**
236    * Method getMapListFromCount.
237    *
238    * @return the size of this collection
239    */
 
240  0 toggle public int getMapListFromCount()
241    {
242  0 return this._mapListFromList.size();
243    }
244   
245    /**
246    * Method getMapListTo.
247    *
248    * @param index
249    * @throws java.lang.IndexOutOfBoundsException
250    * if the index given is outside the bounds of the collection
251    * @return the value of the jalview.schemabinding.version2.MapListTo at the
252    * given index
253    */
 
254  0 toggle public jalview.schemabinding.version2.MapListTo getMapListTo(
255    final int index) throws java.lang.IndexOutOfBoundsException
256    {
257    // check bounds for index
258  0 if (index < 0 || index >= this._mapListToList.size())
259    {
260  0 throw new IndexOutOfBoundsException("getMapListTo: Index value '"
261    + index + "' not in range [0.."
262    + (this._mapListToList.size() - 1) + "]");
263    }
264   
265  0 return (jalview.schemabinding.version2.MapListTo) _mapListToList
266    .get(index);
267    }
268   
269    /**
270    * Method getMapListTo.Returns the contents of the collection in an Array.
271    * <p>
272    * Note: Just in case the collection contents are changing in another thread,
273    * we pass a 0-length Array of the correct type into the API call. This way we
274    * <i>know</i> that the Array returned is of exactly the correct length.
275    *
276    * @return this collection as an Array
277    */
 
278  0 toggle public jalview.schemabinding.version2.MapListTo[] getMapListTo()
279    {
280  0 jalview.schemabinding.version2.MapListTo[] array = new jalview.schemabinding.version2.MapListTo[0];
281  0 return (jalview.schemabinding.version2.MapListTo[]) this._mapListToList
282    .toArray(array);
283    }
284   
285    /**
286    * Method getMapListToCount.
287    *
288    * @return the size of this collection
289    */
 
290  0 toggle public int getMapListToCount()
291    {
292  0 return this._mapListToList.size();
293    }
294   
295    /**
296    * Returns the value of field 'mapToUnit'. The field 'mapToUnit' has the
297    * following description: number of dictionary symbol widths involved in each
298    * mapped position on this sequence (for example, 3 for a dna sequence exon
299    * region that is being mapped to a protein sequence). This is optional, since
300    * the unit can be usually be inferred from the dictionary type of each
301    * sequence involved in the mapping.
302    *
303    * @return the value of field 'MapToUnit'.
304    */
 
305  0 toggle public long getMapToUnit()
306    {
307  0 return this._mapToUnit;
308    }
309   
310    /**
311    * Method hasMapFromUnit.
312    *
313    * @return true if at least one MapFromUnit has been added
314    */
 
315  0 toggle public boolean hasMapFromUnit()
316    {
317  0 return this._has_mapFromUnit;
318    }
319   
320    /**
321    * Method hasMapToUnit.
322    *
323    * @return true if at least one MapToUnit has been added
324    */
 
325  0 toggle public boolean hasMapToUnit()
326    {
327  0 return this._has_mapToUnit;
328    }
329   
330    /**
331    * Method isValid.
332    *
333    * @return true if this object is valid according to the schema
334    */
 
335  0 toggle public boolean isValid()
336    {
337  0 try
338    {
339  0 validate();
340    } catch (org.exolab.castor.xml.ValidationException vex)
341    {
342  0 return false;
343    }
344  0 return true;
345    }
346   
347    /**
348    *
349    *
350    * @param out
351    * @throws org.exolab.castor.xml.MarshalException
352    * if object is null or if any SAXException is thrown during
353    * marshaling
354    * @throws org.exolab.castor.xml.ValidationException
355    * if this object is an invalid instance according to the schema
356    */
 
357  0 toggle public void marshal(final java.io.Writer out)
358    throws org.exolab.castor.xml.MarshalException,
359    org.exolab.castor.xml.ValidationException
360    {
361  0 Marshaller.marshal(this, out);
362    }
363   
364    /**
365    *
366    *
367    * @param handler
368    * @throws java.io.IOException
369    * if an IOException occurs during marshaling
370    * @throws org.exolab.castor.xml.ValidationException
371    * if this object is an invalid instance according to the schema
372    * @throws org.exolab.castor.xml.MarshalException
373    * if object is null or if any SAXException is thrown during
374    * marshaling
375    */
 
376  0 toggle public void marshal(final org.xml.sax.ContentHandler handler)
377    throws java.io.IOException,
378    org.exolab.castor.xml.MarshalException,
379    org.exolab.castor.xml.ValidationException
380    {
381  0 Marshaller.marshal(this, handler);
382    }
383   
384    /**
385    */
 
386  0 toggle public void removeAllMapListFrom()
387    {
388  0 this._mapListFromList.clear();
389    }
390   
391    /**
392    */
 
393  0 toggle public void removeAllMapListTo()
394    {
395  0 this._mapListToList.clear();
396    }
397   
398    /**
399    * Method removeMapListFrom.
400    *
401    * @param vMapListFrom
402    * @return true if the object was removed from the collection.
403    */
 
404  0 toggle public boolean removeMapListFrom(
405    final jalview.schemabinding.version2.MapListFrom vMapListFrom)
406    {
407  0 boolean removed = _mapListFromList.remove(vMapListFrom);
408  0 return removed;
409    }
410   
411    /**
412    * Method removeMapListFromAt.
413    *
414    * @param index
415    * @return the element removed from the collection
416    */
 
417  0 toggle public jalview.schemabinding.version2.MapListFrom removeMapListFromAt(
418    final int index)
419    {
420  0 java.lang.Object obj = this._mapListFromList.remove(index);
421  0 return (jalview.schemabinding.version2.MapListFrom) obj;
422    }
423   
424    /**
425    * Method removeMapListTo.
426    *
427    * @param vMapListTo
428    * @return true if the object was removed from the collection.
429    */
 
430  0 toggle public boolean removeMapListTo(
431    final jalview.schemabinding.version2.MapListTo vMapListTo)
432    {
433  0 boolean removed = _mapListToList.remove(vMapListTo);
434  0 return removed;
435    }
436   
437    /**
438    * Method removeMapListToAt.
439    *
440    * @param index
441    * @return the element removed from the collection
442    */
 
443  0 toggle public jalview.schemabinding.version2.MapListTo removeMapListToAt(
444    final int index)
445    {
446  0 java.lang.Object obj = this._mapListToList.remove(index);
447  0 return (jalview.schemabinding.version2.MapListTo) obj;
448    }
449   
450    /**
451    * Sets the value of field 'mapFromUnit'. The field 'mapFromUnit' has the
452    * following description: number of dictionary symbol widths involved in each
453    * mapped position on this sequence (for example, 3 for a dna sequence exon
454    * region that is being mapped to a protein sequence). This is optional, since
455    * the unit can be usually be inferred from the dictionary type of each
456    * sequence involved in the mapping.
457    *
458    * @param mapFromUnit
459    * the value of field 'mapFromUnit'.
460    */
 
461  0 toggle public void setMapFromUnit(final long mapFromUnit)
462    {
463  0 this._mapFromUnit = mapFromUnit;
464  0 this._has_mapFromUnit = true;
465    }
466   
467    /**
468    *
469    *
470    * @param index
471    * @param vMapListFrom
472    * @throws java.lang.IndexOutOfBoundsException
473    * if the index given is outside the bounds of the collection
474    */
 
475  0 toggle public void setMapListFrom(final int index,
476    final jalview.schemabinding.version2.MapListFrom vMapListFrom)
477    throws java.lang.IndexOutOfBoundsException
478    {
479    // check bounds for index
480  0 if (index < 0 || index >= this._mapListFromList.size())
481    {
482  0 throw new IndexOutOfBoundsException("setMapListFrom: Index value '"
483    + index + "' not in range [0.."
484    + (this._mapListFromList.size() - 1) + "]");
485    }
486   
487  0 this._mapListFromList.set(index, vMapListFrom);
488    }
489   
490    /**
491    *
492    *
493    * @param vMapListFromArray
494    */
 
495  0 toggle public void setMapListFrom(
496    final jalview.schemabinding.version2.MapListFrom[] vMapListFromArray)
497    {
498    // -- copy array
499  0 _mapListFromList.clear();
500   
501  0 for (int i = 0; i < vMapListFromArray.length; i++)
502    {
503  0 this._mapListFromList.add(vMapListFromArray[i]);
504    }
505    }
506   
507    /**
508    *
509    *
510    * @param index
511    * @param vMapListTo
512    * @throws java.lang.IndexOutOfBoundsException
513    * if the index given is outside the bounds of the collection
514    */
 
515  0 toggle public void setMapListTo(final int index,
516    final jalview.schemabinding.version2.MapListTo vMapListTo)
517    throws java.lang.IndexOutOfBoundsException
518    {
519    // check bounds for index
520  0 if (index < 0 || index >= this._mapListToList.size())
521    {
522  0 throw new IndexOutOfBoundsException("setMapListTo: Index value '"
523    + index + "' not in range [0.."
524    + (this._mapListToList.size() - 1) + "]");
525    }
526   
527  0 this._mapListToList.set(index, vMapListTo);
528    }
529   
530    /**
531    *
532    *
533    * @param vMapListToArray
534    */
 
535  0 toggle public void setMapListTo(
536    final jalview.schemabinding.version2.MapListTo[] vMapListToArray)
537    {
538    // -- copy array
539  0 _mapListToList.clear();
540   
541  0 for (int i = 0; i < vMapListToArray.length; i++)
542    {
543  0 this._mapListToList.add(vMapListToArray[i]);
544    }
545    }
546   
547    /**
548    * Sets the value of field 'mapToUnit'. The field 'mapToUnit' has the
549    * following description: number of dictionary symbol widths involved in each
550    * mapped position on this sequence (for example, 3 for a dna sequence exon
551    * region that is being mapped to a protein sequence). This is optional, since
552    * the unit can be usually be inferred from the dictionary type of each
553    * sequence involved in the mapping.
554    *
555    * @param mapToUnit
556    * the value of field 'mapToUnit'.
557    */
 
558  0 toggle public void setMapToUnit(final long mapToUnit)
559    {
560  0 this._mapToUnit = mapToUnit;
561  0 this._has_mapToUnit = true;
562    }
563   
564    /**
565    * Method unmarshal.
566    *
567    * @param reader
568    * @throws org.exolab.castor.xml.MarshalException
569    * if object is null or if any SAXException is thrown during
570    * marshaling
571    * @throws org.exolab.castor.xml.ValidationException
572    * if this object is an invalid instance according to the schema
573    * @return the unmarshaled jalview.schemabinding.version2.MapListType
574    */
 
575  0 toggle public static jalview.schemabinding.version2.MapListType unmarshal(
576    final java.io.Reader reader)
577    throws org.exolab.castor.xml.MarshalException,
578    org.exolab.castor.xml.ValidationException
579    {
580  0 return (jalview.schemabinding.version2.MapListType) Unmarshaller
581    .unmarshal(jalview.schemabinding.version2.MapListType.class,
582    reader);
583    }
584   
585    /**
586    *
587    *
588    * @throws org.exolab.castor.xml.ValidationException
589    * if this object is an invalid instance according to the schema
590    */
 
591  0 toggle public void validate() throws org.exolab.castor.xml.ValidationException
592    {
593  0 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
594  0 validator.validate(this);
595    }
596   
597    }