90bee0fd1324137aee012236dfdf93f44d00be95
[jalview.git] / src / jalview / schemabinding / version2 / JSeq.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
3  * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  * \r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License\r
7  * as published by the Free Software Foundation; either version 2\r
8  * of the License, or (at your option) any later version.\r
9  * \r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  * \r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18  */\r
19 package jalview.schemabinding.version2;\r
20 \r
21 // ---------------------------------/\r
22 // - Imported classes and packages -/\r
23 // ---------------------------------/\r
24 \r
25 import org.exolab.castor.xml.Marshaller;\r
26 import org.exolab.castor.xml.Unmarshaller;\r
27 \r
28 /**\r
29  * Class JSeq.\r
30  * \r
31  * @version $Revision$ $Date$\r
32  */\r
33 public class JSeq implements java.io.Serializable\r
34 {\r
35 \r
36   // --------------------------/\r
37   // - Class/Member Variables -/\r
38   // --------------------------/\r
39 \r
40   /**\r
41    * Field _colour.\r
42    */\r
43   private int _colour;\r
44 \r
45   /**\r
46    * keeps track of state for field: _colour\r
47    */\r
48   private boolean _has_colour;\r
49 \r
50   /**\r
51    * Field _start.\r
52    */\r
53   private int _start;\r
54 \r
55   /**\r
56    * keeps track of state for field: _start\r
57    */\r
58   private boolean _has_start;\r
59 \r
60   /**\r
61    * Field _end.\r
62    */\r
63   private int _end;\r
64 \r
65   /**\r
66    * keeps track of state for field: _end\r
67    */\r
68   private boolean _has_end;\r
69 \r
70   /**\r
71    * Field _id.\r
72    */\r
73   private java.lang.String _id;\r
74 \r
75   /**\r
76    * Field _hidden.\r
77    */\r
78   private boolean _hidden;\r
79 \r
80   /**\r
81    * keeps track of state for field: _hidden\r
82    */\r
83   private boolean _has_hidden;\r
84 \r
85   /**\r
86    * Field _featuresList.\r
87    */\r
88   private java.util.Vector _featuresList;\r
89 \r
90   /**\r
91    * Field _pdbidsList.\r
92    */\r
93   private java.util.Vector _pdbidsList;\r
94 \r
95   /**\r
96    * Field _hiddenSequencesList.\r
97    */\r
98   private java.util.Vector _hiddenSequencesList;\r
99 \r
100   // ----------------/\r
101   // - Constructors -/\r
102   // ----------------/\r
103 \r
104   public JSeq()\r
105   {\r
106     super();\r
107     this._featuresList = new java.util.Vector();\r
108     this._pdbidsList = new java.util.Vector();\r
109     this._hiddenSequencesList = new java.util.Vector();\r
110   }\r
111 \r
112   // -----------/\r
113   // - Methods -/\r
114   // -----------/\r
115 \r
116   /**\r
117    * \r
118    * \r
119    * @param vFeatures\r
120    * @throws java.lang.IndexOutOfBoundsException\r
121    *                 if the index given is outside the bounds of the collection\r
122    */\r
123   public void addFeatures(\r
124           final jalview.schemabinding.version2.Features vFeatures)\r
125           throws java.lang.IndexOutOfBoundsException\r
126   {\r
127     this._featuresList.addElement(vFeatures);\r
128   }\r
129 \r
130   /**\r
131    * \r
132    * \r
133    * @param index\r
134    * @param vFeatures\r
135    * @throws java.lang.IndexOutOfBoundsException\r
136    *                 if the index given is outside the bounds of the collection\r
137    */\r
138   public void addFeatures(final int index,\r
139           final jalview.schemabinding.version2.Features vFeatures)\r
140           throws java.lang.IndexOutOfBoundsException\r
141   {\r
142     this._featuresList.add(index, vFeatures);\r
143   }\r
144 \r
145   /**\r
146    * \r
147    * \r
148    * @param vHiddenSequences\r
149    * @throws java.lang.IndexOutOfBoundsException\r
150    *                 if the index given is outside the bounds of the collection\r
151    */\r
152   public void addHiddenSequences(final int vHiddenSequences)\r
153           throws java.lang.IndexOutOfBoundsException\r
154   {\r
155     this._hiddenSequencesList.addElement(new java.lang.Integer(\r
156             vHiddenSequences));\r
157   }\r
158 \r
159   /**\r
160    * \r
161    * \r
162    * @param index\r
163    * @param vHiddenSequences\r
164    * @throws java.lang.IndexOutOfBoundsException\r
165    *                 if the index given is outside the bounds of the collection\r
166    */\r
167   public void addHiddenSequences(final int index, final int vHiddenSequences)\r
168           throws java.lang.IndexOutOfBoundsException\r
169   {\r
170     this._hiddenSequencesList.add(index, new java.lang.Integer(\r
171             vHiddenSequences));\r
172   }\r
173 \r
174   /**\r
175    * \r
176    * \r
177    * @param vPdbids\r
178    * @throws java.lang.IndexOutOfBoundsException\r
179    *                 if the index given is outside the bounds of the collection\r
180    */\r
181   public void addPdbids(final jalview.schemabinding.version2.Pdbids vPdbids)\r
182           throws java.lang.IndexOutOfBoundsException\r
183   {\r
184     this._pdbidsList.addElement(vPdbids);\r
185   }\r
186 \r
187   /**\r
188    * \r
189    * \r
190    * @param index\r
191    * @param vPdbids\r
192    * @throws java.lang.IndexOutOfBoundsException\r
193    *                 if the index given is outside the bounds of the collection\r
194    */\r
195   public void addPdbids(final int index,\r
196           final jalview.schemabinding.version2.Pdbids vPdbids)\r
197           throws java.lang.IndexOutOfBoundsException\r
198   {\r
199     this._pdbidsList.add(index, vPdbids);\r
200   }\r
201 \r
202   /**\r
203    */\r
204   public void deleteColour()\r
205   {\r
206     this._has_colour = false;\r
207   }\r
208 \r
209   /**\r
210    */\r
211   public void deleteEnd()\r
212   {\r
213     this._has_end = false;\r
214   }\r
215 \r
216   /**\r
217    */\r
218   public void deleteHidden()\r
219   {\r
220     this._has_hidden = false;\r
221   }\r
222 \r
223   /**\r
224    */\r
225   public void deleteStart()\r
226   {\r
227     this._has_start = false;\r
228   }\r
229 \r
230   /**\r
231    * Method enumerateFeatures.\r
232    * \r
233    * @return an Enumeration over all jalview.schemabinding.version2.Features\r
234    *         elements\r
235    */\r
236   public java.util.Enumeration enumerateFeatures()\r
237   {\r
238     return this._featuresList.elements();\r
239   }\r
240 \r
241   /**\r
242    * Method enumerateHiddenSequences.\r
243    * \r
244    * @return an Enumeration over all int elements\r
245    */\r
246   public java.util.Enumeration enumerateHiddenSequences()\r
247   {\r
248     return this._hiddenSequencesList.elements();\r
249   }\r
250 \r
251   /**\r
252    * Method enumeratePdbids.\r
253    * \r
254    * @return an Enumeration over all jalview.schemabinding.version2.Pdbids\r
255    *         elements\r
256    */\r
257   public java.util.Enumeration enumeratePdbids()\r
258   {\r
259     return this._pdbidsList.elements();\r
260   }\r
261 \r
262   /**\r
263    * Returns the value of field 'colour'.\r
264    * \r
265    * @return the value of field 'Colour'.\r
266    */\r
267   public int getColour()\r
268   {\r
269     return this._colour;\r
270   }\r
271 \r
272   /**\r
273    * Returns the value of field 'end'.\r
274    * \r
275    * @return the value of field 'End'.\r
276    */\r
277   public int getEnd()\r
278   {\r
279     return this._end;\r
280   }\r
281 \r
282   /**\r
283    * Method getFeatures.\r
284    * \r
285    * @param index\r
286    * @throws java.lang.IndexOutOfBoundsException\r
287    *                 if the index given is outside the bounds of the collection\r
288    * @return the value of the jalview.schemabinding.version2.Features at the\r
289    *         given index\r
290    */\r
291   public jalview.schemabinding.version2.Features getFeatures(final int index)\r
292           throws java.lang.IndexOutOfBoundsException\r
293   {\r
294     // check bounds for index\r
295     if (index < 0 || index >= this._featuresList.size())\r
296     {\r
297       throw new IndexOutOfBoundsException("getFeatures: Index value '"\r
298               + index + "' not in range [0.."\r
299               + (this._featuresList.size() - 1) + "]");\r
300     }\r
301 \r
302     return (jalview.schemabinding.version2.Features) _featuresList\r
303             .get(index);\r
304   }\r
305 \r
306   /**\r
307    * Method getFeatures.Returns the contents of the collection in an Array.\r
308    * <p>\r
309    * Note: Just in case the collection contents are changing in another thread,\r
310    * we pass a 0-length Array of the correct type into the API call. This way we\r
311    * <i>know</i> that the Array returned is of exactly the correct length.\r
312    * \r
313    * @return this collection as an Array\r
314    */\r
315   public jalview.schemabinding.version2.Features[] getFeatures()\r
316   {\r
317     jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];\r
318     return (jalview.schemabinding.version2.Features[]) this._featuresList\r
319             .toArray(array);\r
320   }\r
321 \r
322   /**\r
323    * Method getFeaturesCount.\r
324    * \r
325    * @return the size of this collection\r
326    */\r
327   public int getFeaturesCount()\r
328   {\r
329     return this._featuresList.size();\r
330   }\r
331 \r
332   /**\r
333    * Returns the value of field 'hidden'.\r
334    * \r
335    * @return the value of field 'Hidden'.\r
336    */\r
337   public boolean getHidden()\r
338   {\r
339     return this._hidden;\r
340   }\r
341 \r
342   /**\r
343    * Method getHiddenSequences.\r
344    * \r
345    * @param index\r
346    * @throws java.lang.IndexOutOfBoundsException\r
347    *                 if the index given is outside the bounds of the collection\r
348    * @return the value of the int at the given index\r
349    */\r
350   public int getHiddenSequences(final int index)\r
351           throws java.lang.IndexOutOfBoundsException\r
352   {\r
353     // check bounds for index\r
354     if (index < 0 || index >= this._hiddenSequencesList.size())\r
355     {\r
356       throw new IndexOutOfBoundsException(\r
357               "getHiddenSequences: Index value '" + index\r
358                       + "' not in range [0.."\r
359                       + (this._hiddenSequencesList.size() - 1) + "]");\r
360     }\r
361 \r
362     return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();\r
363   }\r
364 \r
365   /**\r
366    * Method getHiddenSequences.Returns the contents of the collection in an\r
367    * Array.\r
368    * \r
369    * @return this collection as an Array\r
370    */\r
371   public int[] getHiddenSequences()\r
372   {\r
373     int size = this._hiddenSequencesList.size();\r
374     int[] array = new int[size];\r
375     java.util.Iterator iter = _hiddenSequencesList.iterator();\r
376     for (int index = 0; index < size; index++)\r
377     {\r
378       array[index] = ((java.lang.Integer) iter.next()).intValue();\r
379     }\r
380     return array;\r
381   }\r
382 \r
383   /**\r
384    * Method getHiddenSequencesCount.\r
385    * \r
386    * @return the size of this collection\r
387    */\r
388   public int getHiddenSequencesCount()\r
389   {\r
390     return this._hiddenSequencesList.size();\r
391   }\r
392 \r
393   /**\r
394    * Returns the value of field 'id'.\r
395    * \r
396    * @return the value of field 'Id'.\r
397    */\r
398   public java.lang.String getId()\r
399   {\r
400     return this._id;\r
401   }\r
402 \r
403   /**\r
404    * Method getPdbids.\r
405    * \r
406    * @param index\r
407    * @throws java.lang.IndexOutOfBoundsException\r
408    *                 if the index given is outside the bounds of the collection\r
409    * @return the value of the jalview.schemabinding.version2.Pdbids at the given\r
410    *         index\r
411    */\r
412   public jalview.schemabinding.version2.Pdbids getPdbids(final int index)\r
413           throws java.lang.IndexOutOfBoundsException\r
414   {\r
415     // check bounds for index\r
416     if (index < 0 || index >= this._pdbidsList.size())\r
417     {\r
418       throw new IndexOutOfBoundsException("getPdbids: Index value '"\r
419               + index + "' not in range [0.."\r
420               + (this._pdbidsList.size() - 1) + "]");\r
421     }\r
422 \r
423     return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);\r
424   }\r
425 \r
426   /**\r
427    * Method getPdbids.Returns the contents of the collection in an Array.\r
428    * <p>\r
429    * Note: Just in case the collection contents are changing in another thread,\r
430    * we pass a 0-length Array of the correct type into the API call. This way we\r
431    * <i>know</i> that the Array returned is of exactly the correct length.\r
432    * \r
433    * @return this collection as an Array\r
434    */\r
435   public jalview.schemabinding.version2.Pdbids[] getPdbids()\r
436   {\r
437     jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];\r
438     return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList\r
439             .toArray(array);\r
440   }\r
441 \r
442   /**\r
443    * Method getPdbidsCount.\r
444    * \r
445    * @return the size of this collection\r
446    */\r
447   public int getPdbidsCount()\r
448   {\r
449     return this._pdbidsList.size();\r
450   }\r
451 \r
452   /**\r
453    * Returns the value of field 'start'.\r
454    * \r
455    * @return the value of field 'Start'.\r
456    */\r
457   public int getStart()\r
458   {\r
459     return this._start;\r
460   }\r
461 \r
462   /**\r
463    * Method hasColour.\r
464    * \r
465    * @return true if at least one Colour has been added\r
466    */\r
467   public boolean hasColour()\r
468   {\r
469     return this._has_colour;\r
470   }\r
471 \r
472   /**\r
473    * Method hasEnd.\r
474    * \r
475    * @return true if at least one End has been added\r
476    */\r
477   public boolean hasEnd()\r
478   {\r
479     return this._has_end;\r
480   }\r
481 \r
482   /**\r
483    * Method hasHidden.\r
484    * \r
485    * @return true if at least one Hidden has been added\r
486    */\r
487   public boolean hasHidden()\r
488   {\r
489     return this._has_hidden;\r
490   }\r
491 \r
492   /**\r
493    * Method hasStart.\r
494    * \r
495    * @return true if at least one Start has been added\r
496    */\r
497   public boolean hasStart()\r
498   {\r
499     return this._has_start;\r
500   }\r
501 \r
502   /**\r
503    * Returns the value of field 'hidden'.\r
504    * \r
505    * @return the value of field 'Hidden'.\r
506    */\r
507   public boolean isHidden()\r
508   {\r
509     return this._hidden;\r
510   }\r
511 \r
512   /**\r
513    * Method isValid.\r
514    * \r
515    * @return true if this object is valid according to the schema\r
516    */\r
517   public boolean isValid()\r
518   {\r
519     try\r
520     {\r
521       validate();\r
522     } catch (org.exolab.castor.xml.ValidationException vex)\r
523     {\r
524       return false;\r
525     }\r
526     return true;\r
527   }\r
528 \r
529   /**\r
530    * \r
531    * \r
532    * @param out\r
533    * @throws org.exolab.castor.xml.MarshalException\r
534    *                 if object is null or if any SAXException is thrown during\r
535    *                 marshaling\r
536    * @throws org.exolab.castor.xml.ValidationException\r
537    *                 if this object is an invalid instance according to the\r
538    *                 schema\r
539    */\r
540   public void marshal(final java.io.Writer out)\r
541           throws org.exolab.castor.xml.MarshalException,\r
542           org.exolab.castor.xml.ValidationException\r
543   {\r
544     Marshaller.marshal(this, out);\r
545   }\r
546 \r
547   /**\r
548    * \r
549    * \r
550    * @param handler\r
551    * @throws java.io.IOException\r
552    *                 if an IOException occurs during marshaling\r
553    * @throws org.exolab.castor.xml.ValidationException\r
554    *                 if this object is an invalid instance according to the\r
555    *                 schema\r
556    * @throws org.exolab.castor.xml.MarshalException\r
557    *                 if object is null or if any SAXException is thrown during\r
558    *                 marshaling\r
559    */\r
560   public void marshal(final org.xml.sax.ContentHandler handler)\r
561           throws java.io.IOException,\r
562           org.exolab.castor.xml.MarshalException,\r
563           org.exolab.castor.xml.ValidationException\r
564   {\r
565     Marshaller.marshal(this, handler);\r
566   }\r
567 \r
568   /**\r
569    */\r
570   public void removeAllFeatures()\r
571   {\r
572     this._featuresList.clear();\r
573   }\r
574 \r
575   /**\r
576    */\r
577   public void removeAllHiddenSequences()\r
578   {\r
579     this._hiddenSequencesList.clear();\r
580   }\r
581 \r
582   /**\r
583    */\r
584   public void removeAllPdbids()\r
585   {\r
586     this._pdbidsList.clear();\r
587   }\r
588 \r
589   /**\r
590    * Method removeFeatures.\r
591    * \r
592    * @param vFeatures\r
593    * @return true if the object was removed from the collection.\r
594    */\r
595   public boolean removeFeatures(\r
596           final jalview.schemabinding.version2.Features vFeatures)\r
597   {\r
598     boolean removed = _featuresList.remove(vFeatures);\r
599     return removed;\r
600   }\r
601 \r
602   /**\r
603    * Method removeFeaturesAt.\r
604    * \r
605    * @param index\r
606    * @return the element removed from the collection\r
607    */\r
608   public jalview.schemabinding.version2.Features removeFeaturesAt(\r
609           final int index)\r
610   {\r
611     java.lang.Object obj = this._featuresList.remove(index);\r
612     return (jalview.schemabinding.version2.Features) obj;\r
613   }\r
614 \r
615   /**\r
616    * Method removeHiddenSequences.\r
617    * \r
618    * @param vHiddenSequences\r
619    * @return true if the object was removed from the collection.\r
620    */\r
621   public boolean removeHiddenSequences(final int vHiddenSequences)\r
622   {\r
623     boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(\r
624             vHiddenSequences));\r
625     return removed;\r
626   }\r
627 \r
628   /**\r
629    * Method removeHiddenSequencesAt.\r
630    * \r
631    * @param index\r
632    * @return the element removed from the collection\r
633    */\r
634   public int removeHiddenSequencesAt(final int index)\r
635   {\r
636     java.lang.Object obj = this._hiddenSequencesList.remove(index);\r
637     return ((java.lang.Integer) obj).intValue();\r
638   }\r
639 \r
640   /**\r
641    * Method removePdbids.\r
642    * \r
643    * @param vPdbids\r
644    * @return true if the object was removed from the collection.\r
645    */\r
646   public boolean removePdbids(\r
647           final jalview.schemabinding.version2.Pdbids vPdbids)\r
648   {\r
649     boolean removed = _pdbidsList.remove(vPdbids);\r
650     return removed;\r
651   }\r
652 \r
653   /**\r
654    * Method removePdbidsAt.\r
655    * \r
656    * @param index\r
657    * @return the element removed from the collection\r
658    */\r
659   public jalview.schemabinding.version2.Pdbids removePdbidsAt(\r
660           final int index)\r
661   {\r
662     java.lang.Object obj = this._pdbidsList.remove(index);\r
663     return (jalview.schemabinding.version2.Pdbids) obj;\r
664   }\r
665 \r
666   /**\r
667    * Sets the value of field 'colour'.\r
668    * \r
669    * @param colour\r
670    *                the value of field 'colour'.\r
671    */\r
672   public void setColour(final int colour)\r
673   {\r
674     this._colour = colour;\r
675     this._has_colour = true;\r
676   }\r
677 \r
678   /**\r
679    * Sets the value of field 'end'.\r
680    * \r
681    * @param end\r
682    *                the value of field 'end'.\r
683    */\r
684   public void setEnd(final int end)\r
685   {\r
686     this._end = end;\r
687     this._has_end = true;\r
688   }\r
689 \r
690   /**\r
691    * \r
692    * \r
693    * @param index\r
694    * @param vFeatures\r
695    * @throws java.lang.IndexOutOfBoundsException\r
696    *                 if the index given is outside the bounds of the collection\r
697    */\r
698   public void setFeatures(final int index,\r
699           final jalview.schemabinding.version2.Features vFeatures)\r
700           throws java.lang.IndexOutOfBoundsException\r
701   {\r
702     // check bounds for index\r
703     if (index < 0 || index >= this._featuresList.size())\r
704     {\r
705       throw new IndexOutOfBoundsException("setFeatures: Index value '"\r
706               + index + "' not in range [0.."\r
707               + (this._featuresList.size() - 1) + "]");\r
708     }\r
709 \r
710     this._featuresList.set(index, vFeatures);\r
711   }\r
712 \r
713   /**\r
714    * \r
715    * \r
716    * @param vFeaturesArray\r
717    */\r
718   public void setFeatures(\r
719           final jalview.schemabinding.version2.Features[] vFeaturesArray)\r
720   {\r
721     // -- copy array\r
722     _featuresList.clear();\r
723 \r
724     for (int i = 0; i < vFeaturesArray.length; i++)\r
725     {\r
726       this._featuresList.add(vFeaturesArray[i]);\r
727     }\r
728   }\r
729 \r
730   /**\r
731    * Sets the value of field 'hidden'.\r
732    * \r
733    * @param hidden\r
734    *                the value of field 'hidden'.\r
735    */\r
736   public void setHidden(final boolean hidden)\r
737   {\r
738     this._hidden = hidden;\r
739     this._has_hidden = true;\r
740   }\r
741 \r
742   /**\r
743    * \r
744    * \r
745    * @param index\r
746    * @param vHiddenSequences\r
747    * @throws java.lang.IndexOutOfBoundsException\r
748    *                 if the index given is outside the bounds of the collection\r
749    */\r
750   public void setHiddenSequences(final int index, final int vHiddenSequences)\r
751           throws java.lang.IndexOutOfBoundsException\r
752   {\r
753     // check bounds for index\r
754     if (index < 0 || index >= this._hiddenSequencesList.size())\r
755     {\r
756       throw new IndexOutOfBoundsException(\r
757               "setHiddenSequences: Index value '" + index\r
758                       + "' not in range [0.."\r
759                       + (this._hiddenSequencesList.size() - 1) + "]");\r
760     }\r
761 \r
762     this._hiddenSequencesList.set(index, new java.lang.Integer(\r
763             vHiddenSequences));\r
764   }\r
765 \r
766   /**\r
767    * \r
768    * \r
769    * @param vHiddenSequencesArray\r
770    */\r
771   public void setHiddenSequences(final int[] vHiddenSequencesArray)\r
772   {\r
773     // -- copy array\r
774     _hiddenSequencesList.clear();\r
775 \r
776     for (int i = 0; i < vHiddenSequencesArray.length; i++)\r
777     {\r
778       this._hiddenSequencesList.add(new java.lang.Integer(\r
779               vHiddenSequencesArray[i]));\r
780     }\r
781   }\r
782 \r
783   /**\r
784    * Sets the value of field 'id'.\r
785    * \r
786    * @param id\r
787    *                the value of field 'id'.\r
788    */\r
789   public void setId(final java.lang.String id)\r
790   {\r
791     this._id = id;\r
792   }\r
793 \r
794   /**\r
795    * \r
796    * \r
797    * @param index\r
798    * @param vPdbids\r
799    * @throws java.lang.IndexOutOfBoundsException\r
800    *                 if the index given is outside the bounds of the collection\r
801    */\r
802   public void setPdbids(final int index,\r
803           final jalview.schemabinding.version2.Pdbids vPdbids)\r
804           throws java.lang.IndexOutOfBoundsException\r
805   {\r
806     // check bounds for index\r
807     if (index < 0 || index >= this._pdbidsList.size())\r
808     {\r
809       throw new IndexOutOfBoundsException("setPdbids: Index value '"\r
810               + index + "' not in range [0.."\r
811               + (this._pdbidsList.size() - 1) + "]");\r
812     }\r
813 \r
814     this._pdbidsList.set(index, vPdbids);\r
815   }\r
816 \r
817   /**\r
818    * \r
819    * \r
820    * @param vPdbidsArray\r
821    */\r
822   public void setPdbids(\r
823           final jalview.schemabinding.version2.Pdbids[] vPdbidsArray)\r
824   {\r
825     // -- copy array\r
826     _pdbidsList.clear();\r
827 \r
828     for (int i = 0; i < vPdbidsArray.length; i++)\r
829     {\r
830       this._pdbidsList.add(vPdbidsArray[i]);\r
831     }\r
832   }\r
833 \r
834   /**\r
835    * Sets the value of field 'start'.\r
836    * \r
837    * @param start\r
838    *                the value of field 'start'.\r
839    */\r
840   public void setStart(final int start)\r
841   {\r
842     this._start = start;\r
843     this._has_start = true;\r
844   }\r
845 \r
846   /**\r
847    * Method unmarshal.\r
848    * \r
849    * @param reader\r
850    * @throws org.exolab.castor.xml.MarshalException\r
851    *                 if object is null or if any SAXException is thrown during\r
852    *                 marshaling\r
853    * @throws org.exolab.castor.xml.ValidationException\r
854    *                 if this object is an invalid instance according to the\r
855    *                 schema\r
856    * @return the unmarshaled jalview.schemabinding.version2.JSeq\r
857    */\r
858   public static jalview.schemabinding.version2.JSeq unmarshal(\r
859           final java.io.Reader reader)\r
860           throws org.exolab.castor.xml.MarshalException,\r
861           org.exolab.castor.xml.ValidationException\r
862   {\r
863     return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(\r
864             jalview.schemabinding.version2.JSeq.class, reader);\r
865   }\r
866 \r
867   /**\r
868    * \r
869    * \r
870    * @throws org.exolab.castor.xml.ValidationException\r
871    *                 if this object is an invalid instance according to the\r
872    *                 schema\r
873    */\r
874   public void validate() throws org.exolab.castor.xml.ValidationException\r
875   {\r
876     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
877     validator.validate(this);\r
878   }\r
879 \r
880 }\r