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