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