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