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