2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class SequenceSet implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
32 private java.lang.String _gapChar;
35 * reference to set where jalview will gather the dataset
36 * sequences for all sequences in the set.
39 private java.lang.String _datasetId;
42 * Field _sequenceList.
44 private java.util.Vector _sequenceList;
47 * Field _annotationList.
49 private java.util.Vector _annotationList;
52 * Field _sequenceSetPropertiesList.
54 private java.util.Vector _sequenceSetPropertiesList;
57 * Field _alcodonFrameList.
59 private java.util.Vector _alcodonFrameList;
66 public SequenceSet() {
68 this._sequenceList = new java.util.Vector();
69 this._annotationList = new java.util.Vector();
70 this._sequenceSetPropertiesList = new java.util.Vector();
71 this._alcodonFrameList = new java.util.Vector();
82 * @param vAlcodonFrame
83 * @throws java.lang.IndexOutOfBoundsException if the index
84 * given is outside the bounds of the collection
86 public void addAlcodonFrame(
87 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
88 throws java.lang.IndexOutOfBoundsException {
89 this._alcodonFrameList.addElement(vAlcodonFrame);
96 * @param vAlcodonFrame
97 * @throws java.lang.IndexOutOfBoundsException if the index
98 * given is outside the bounds of the collection
100 public void addAlcodonFrame(
102 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
103 throws java.lang.IndexOutOfBoundsException {
104 this._alcodonFrameList.add(index, vAlcodonFrame);
111 * @throws java.lang.IndexOutOfBoundsException if the index
112 * given is outside the bounds of the collection
114 public void addAnnotation(
115 final jalview.schemabinding.version2.Annotation vAnnotation)
116 throws java.lang.IndexOutOfBoundsException {
117 this._annotationList.addElement(vAnnotation);
125 * @throws java.lang.IndexOutOfBoundsException if the index
126 * given is outside the bounds of the collection
128 public void addAnnotation(
130 final jalview.schemabinding.version2.Annotation vAnnotation)
131 throws java.lang.IndexOutOfBoundsException {
132 this._annotationList.add(index, vAnnotation);
139 * @throws java.lang.IndexOutOfBoundsException if the index
140 * given is outside the bounds of the collection
142 public void addSequence(
143 final jalview.schemabinding.version2.Sequence vSequence)
144 throws java.lang.IndexOutOfBoundsException {
145 this._sequenceList.addElement(vSequence);
153 * @throws java.lang.IndexOutOfBoundsException if the index
154 * given is outside the bounds of the collection
156 public void addSequence(
158 final jalview.schemabinding.version2.Sequence vSequence)
159 throws java.lang.IndexOutOfBoundsException {
160 this._sequenceList.add(index, vSequence);
166 * @param vSequenceSetProperties
167 * @throws java.lang.IndexOutOfBoundsException if the index
168 * given is outside the bounds of the collection
170 public void addSequenceSetProperties(
171 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
172 throws java.lang.IndexOutOfBoundsException {
173 this._sequenceSetPropertiesList.addElement(vSequenceSetProperties);
180 * @param vSequenceSetProperties
181 * @throws java.lang.IndexOutOfBoundsException if the index
182 * given is outside the bounds of the collection
184 public void addSequenceSetProperties(
186 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
187 throws java.lang.IndexOutOfBoundsException {
188 this._sequenceSetPropertiesList.add(index, vSequenceSetProperties);
192 * Method enumerateAlcodonFrame.
194 * @return an Enumeration over all
195 * jalview.schemabinding.version2.AlcodonFrame elements
197 public java.util.Enumeration enumerateAlcodonFrame(
199 return this._alcodonFrameList.elements();
203 * Method enumerateAnnotation.
205 * @return an Enumeration over all
206 * jalview.schemabinding.version2.Annotation elements
208 public java.util.Enumeration enumerateAnnotation(
210 return this._annotationList.elements();
214 * Method enumerateSequence.
216 * @return an Enumeration over all
217 * jalview.schemabinding.version2.Sequence elements
219 public java.util.Enumeration enumerateSequence(
221 return this._sequenceList.elements();
225 * Method enumerateSequenceSetProperties.
227 * @return an Enumeration over all
228 * jalview.schemabinding.version2.SequenceSetProperties elements
230 public java.util.Enumeration enumerateSequenceSetProperties(
232 return this._sequenceSetPropertiesList.elements();
236 * Method getAlcodonFrame.
239 * @throws java.lang.IndexOutOfBoundsException if the index
240 * given is outside the bounds of the collection
241 * @return the value of the
242 * jalview.schemabinding.version2.AlcodonFrame at the given inde
244 public jalview.schemabinding.version2.AlcodonFrame getAlcodonFrame(
246 throws java.lang.IndexOutOfBoundsException {
247 // check bounds for index
248 if (index < 0 || index >= this._alcodonFrameList.size()) {
249 throw new IndexOutOfBoundsException("getAlcodonFrame: Index value '" + index + "' not in range [0.." + (this._alcodonFrameList.size() - 1) + "]");
252 return (jalview.schemabinding.version2.AlcodonFrame) _alcodonFrameList.get(index);
256 * Method getAlcodonFrame.Returns the contents of the
257 * collection in an Array. <p>Note: Just in case the
258 * collection contents are changing in another thread, we pass
259 * a 0-length Array of the correct type into the API call.
260 * This way we <i>know</i> that the Array returned is of
261 * exactly the correct length.
263 * @return this collection as an Array
265 public jalview.schemabinding.version2.AlcodonFrame[] getAlcodonFrame(
267 jalview.schemabinding.version2.AlcodonFrame[] array = new jalview.schemabinding.version2.AlcodonFrame[0];
268 return (jalview.schemabinding.version2.AlcodonFrame[]) this._alcodonFrameList.toArray(array);
272 * Method getAlcodonFrameCount.
274 * @return the size of this collection
276 public int getAlcodonFrameCount(
278 return this._alcodonFrameList.size();
282 * Method getAnnotation.
285 * @throws java.lang.IndexOutOfBoundsException if the index
286 * given is outside the bounds of the collection
287 * @return the value of the
288 * jalview.schemabinding.version2.Annotation at the given index
290 public jalview.schemabinding.version2.Annotation getAnnotation(
292 throws java.lang.IndexOutOfBoundsException {
293 // check bounds for index
294 if (index < 0 || index >= this._annotationList.size()) {
295 throw new IndexOutOfBoundsException("getAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]");
298 return (jalview.schemabinding.version2.Annotation) _annotationList.get(index);
302 * Method getAnnotation.Returns the contents of the collection
303 * in an Array. <p>Note: Just in case the collection contents
304 * are changing in another thread, we pass a 0-length Array of
305 * the correct type into the API call. This way we <i>know</i>
306 * that the Array returned is of exactly the correct length.
308 * @return this collection as an Array
310 public jalview.schemabinding.version2.Annotation[] getAnnotation(
312 jalview.schemabinding.version2.Annotation[] array = new jalview.schemabinding.version2.Annotation[0];
313 return (jalview.schemabinding.version2.Annotation[]) this._annotationList.toArray(array);
317 * Method getAnnotationCount.
319 * @return the size of this collection
321 public int getAnnotationCount(
323 return this._annotationList.size();
327 * Returns the value of field 'datasetId'. The field
328 * 'datasetId' has the following description: reference to set
329 * where jalview will gather the dataset sequences for all
330 * sequences in the set.
333 * @return the value of field 'DatasetId'.
335 public java.lang.String getDatasetId(
337 return this._datasetId;
341 * Returns the value of field 'gapChar'.
343 * @return the value of field 'GapChar'.
345 public java.lang.String getGapChar(
347 return this._gapChar;
351 * Method getSequence.
354 * @throws java.lang.IndexOutOfBoundsException if the index
355 * given is outside the bounds of the collection
356 * @return the value of the
357 * jalview.schemabinding.version2.Sequence at the given index
359 public jalview.schemabinding.version2.Sequence getSequence(
361 throws java.lang.IndexOutOfBoundsException {
362 // check bounds for index
363 if (index < 0 || index >= this._sequenceList.size()) {
364 throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
367 return (jalview.schemabinding.version2.Sequence) _sequenceList.get(index);
371 * Method getSequence.Returns the contents of the collection in
372 * an Array. <p>Note: Just in case the collection contents
373 * are changing in another thread, we pass a 0-length Array of
374 * the correct type into the API call. This way we <i>know</i>
375 * that the Array returned is of exactly the correct length.
377 * @return this collection as an Array
379 public jalview.schemabinding.version2.Sequence[] getSequence(
381 jalview.schemabinding.version2.Sequence[] array = new jalview.schemabinding.version2.Sequence[0];
382 return (jalview.schemabinding.version2.Sequence[]) this._sequenceList.toArray(array);
386 * Method getSequenceCount.
388 * @return the size of this collection
390 public int getSequenceCount(
392 return this._sequenceList.size();
396 * Method getSequenceSetProperties.
399 * @throws java.lang.IndexOutOfBoundsException if the index
400 * given is outside the bounds of the collection
401 * @return the value of the
402 * jalview.schemabinding.version2.SequenceSetProperties at the
405 public jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties(
407 throws java.lang.IndexOutOfBoundsException {
408 // check bounds for index
409 if (index < 0 || index >= this._sequenceSetPropertiesList.size()) {
410 throw new IndexOutOfBoundsException("getSequenceSetProperties: Index value '" + index + "' not in range [0.." + (this._sequenceSetPropertiesList.size() - 1) + "]");
413 return (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList.get(index);
417 * Method getSequenceSetProperties.Returns the contents of the
418 * collection in an Array. <p>Note: Just in case the
419 * collection contents are changing in another thread, we pass
420 * a 0-length Array of the correct type into the API call.
421 * This way we <i>know</i> that the Array returned is of
422 * exactly the correct length.
424 * @return this collection as an Array
426 public jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties(
428 jalview.schemabinding.version2.SequenceSetProperties[] array = new jalview.schemabinding.version2.SequenceSetProperties[0];
429 return (jalview.schemabinding.version2.SequenceSetProperties[]) this._sequenceSetPropertiesList.toArray(array);
433 * Method getSequenceSetPropertiesCount.
435 * @return the size of this collection
437 public int getSequenceSetPropertiesCount(
439 return this._sequenceSetPropertiesList.size();
445 * @return true if this object is valid according to the schema
447 public boolean isValid(
451 } catch (org.exolab.castor.xml.ValidationException vex) {
461 * @throws org.exolab.castor.xml.MarshalException if object is
462 * null or if any SAXException is thrown during marshaling
463 * @throws org.exolab.castor.xml.ValidationException if this
464 * object is an invalid instance according to the schema
467 final java.io.Writer out)
468 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
469 Marshaller.marshal(this, out);
476 * @throws java.io.IOException if an IOException occurs during
478 * @throws org.exolab.castor.xml.ValidationException if this
479 * object is an invalid instance according to the schema
480 * @throws org.exolab.castor.xml.MarshalException if object is
481 * null or if any SAXException is thrown during marshaling
484 final org.xml.sax.ContentHandler handler)
485 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
486 Marshaller.marshal(this, handler);
490 * Method removeAlcodonFrame.
492 * @param vAlcodonFrame
493 * @return true if the object was removed from the collection.
495 public boolean removeAlcodonFrame(
496 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) {
497 boolean removed = _alcodonFrameList.remove(vAlcodonFrame);
502 * Method removeAlcodonFrameAt.
505 * @return the element removed from the collection
507 public jalview.schemabinding.version2.AlcodonFrame removeAlcodonFrameAt(
509 java.lang.Object obj = this._alcodonFrameList.remove(index);
510 return (jalview.schemabinding.version2.AlcodonFrame) obj;
515 public void removeAllAlcodonFrame(
517 this._alcodonFrameList.clear();
522 public void removeAllAnnotation(
524 this._annotationList.clear();
529 public void removeAllSequence(
531 this._sequenceList.clear();
536 public void removeAllSequenceSetProperties(
538 this._sequenceSetPropertiesList.clear();
542 * Method removeAnnotation.
545 * @return true if the object was removed from the collection.
547 public boolean removeAnnotation(
548 final jalview.schemabinding.version2.Annotation vAnnotation) {
549 boolean removed = _annotationList.remove(vAnnotation);
554 * Method removeAnnotationAt.
557 * @return the element removed from the collection
559 public jalview.schemabinding.version2.Annotation removeAnnotationAt(
561 java.lang.Object obj = this._annotationList.remove(index);
562 return (jalview.schemabinding.version2.Annotation) obj;
566 * Method removeSequence.
569 * @return true if the object was removed from the collection.
571 public boolean removeSequence(
572 final jalview.schemabinding.version2.Sequence vSequence) {
573 boolean removed = _sequenceList.remove(vSequence);
578 * Method removeSequenceAt.
581 * @return the element removed from the collection
583 public jalview.schemabinding.version2.Sequence removeSequenceAt(
585 java.lang.Object obj = this._sequenceList.remove(index);
586 return (jalview.schemabinding.version2.Sequence) obj;
590 * Method removeSequenceSetProperties.
592 * @param vSequenceSetProperties
593 * @return true if the object was removed from the collection.
595 public boolean removeSequenceSetProperties(
596 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) {
597 boolean removed = _sequenceSetPropertiesList.remove(vSequenceSetProperties);
602 * Method removeSequenceSetPropertiesAt.
605 * @return the element removed from the collection
607 public jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetPropertiesAt(
609 java.lang.Object obj = this._sequenceSetPropertiesList.remove(index);
610 return (jalview.schemabinding.version2.SequenceSetProperties) obj;
617 * @param vAlcodonFrame
618 * @throws java.lang.IndexOutOfBoundsException if the index
619 * given is outside the bounds of the collection
621 public void setAlcodonFrame(
623 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
624 throws java.lang.IndexOutOfBoundsException {
625 // check bounds for index
626 if (index < 0 || index >= this._alcodonFrameList.size()) {
627 throw new IndexOutOfBoundsException("setAlcodonFrame: Index value '" + index + "' not in range [0.." + (this._alcodonFrameList.size() - 1) + "]");
630 this._alcodonFrameList.set(index, vAlcodonFrame);
636 * @param vAlcodonFrameArray
638 public void setAlcodonFrame(
639 final jalview.schemabinding.version2.AlcodonFrame[] vAlcodonFrameArray) {
641 _alcodonFrameList.clear();
643 for (int i = 0; i < vAlcodonFrameArray.length; i++) {
644 this._alcodonFrameList.add(vAlcodonFrameArray[i]);
653 * @throws java.lang.IndexOutOfBoundsException if the index
654 * given is outside the bounds of the collection
656 public void setAnnotation(
658 final jalview.schemabinding.version2.Annotation vAnnotation)
659 throws java.lang.IndexOutOfBoundsException {
660 // check bounds for index
661 if (index < 0 || index >= this._annotationList.size()) {
662 throw new IndexOutOfBoundsException("setAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]");
665 this._annotationList.set(index, vAnnotation);
671 * @param vAnnotationArray
673 public void setAnnotation(
674 final jalview.schemabinding.version2.Annotation[] vAnnotationArray) {
676 _annotationList.clear();
678 for (int i = 0; i < vAnnotationArray.length; i++) {
679 this._annotationList.add(vAnnotationArray[i]);
684 * Sets the value of field 'datasetId'. The field 'datasetId'
685 * has the following description: reference to set where
686 * jalview will gather the dataset sequences for all sequences
690 * @param datasetId the value of field 'datasetId'.
692 public void setDatasetId(
693 final java.lang.String datasetId) {
694 this._datasetId = datasetId;
698 * Sets the value of field 'gapChar'.
700 * @param gapChar the value of field 'gapChar'.
702 public void setGapChar(
703 final java.lang.String gapChar) {
704 this._gapChar = gapChar;
712 * @throws java.lang.IndexOutOfBoundsException if the index
713 * given is outside the bounds of the collection
715 public void setSequence(
717 final jalview.schemabinding.version2.Sequence vSequence)
718 throws java.lang.IndexOutOfBoundsException {
719 // check bounds for index
720 if (index < 0 || index >= this._sequenceList.size()) {
721 throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
724 this._sequenceList.set(index, vSequence);
730 * @param vSequenceArray
732 public void setSequence(
733 final jalview.schemabinding.version2.Sequence[] vSequenceArray) {
735 _sequenceList.clear();
737 for (int i = 0; i < vSequenceArray.length; i++) {
738 this._sequenceList.add(vSequenceArray[i]);
746 * @param vSequenceSetProperties
747 * @throws java.lang.IndexOutOfBoundsException if the index
748 * given is outside the bounds of the collection
750 public void setSequenceSetProperties(
752 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
753 throws java.lang.IndexOutOfBoundsException {
754 // check bounds for index
755 if (index < 0 || index >= this._sequenceSetPropertiesList.size()) {
756 throw new IndexOutOfBoundsException("setSequenceSetProperties: Index value '" + index + "' not in range [0.." + (this._sequenceSetPropertiesList.size() - 1) + "]");
759 this._sequenceSetPropertiesList.set(index, vSequenceSetProperties);
765 * @param vSequenceSetPropertiesArray
767 public void setSequenceSetProperties(
768 final jalview.schemabinding.version2.SequenceSetProperties[] vSequenceSetPropertiesArray) {
770 _sequenceSetPropertiesList.clear();
772 for (int i = 0; i < vSequenceSetPropertiesArray.length; i++) {
773 this._sequenceSetPropertiesList.add(vSequenceSetPropertiesArray[i]);
781 * @throws org.exolab.castor.xml.MarshalException if object is
782 * null or if any SAXException is thrown during marshaling
783 * @throws org.exolab.castor.xml.ValidationException if this
784 * object is an invalid instance according to the schema
785 * @return the unmarshaled
786 * jalview.schemabinding.version2.SequenceSet
788 public static jalview.schemabinding.version2.SequenceSet unmarshal(
789 final java.io.Reader reader)
790 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
791 return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSet.class, reader);
797 * @throws org.exolab.castor.xml.ValidationException if this
798 * object is an invalid instance according to the schema
800 public void validate(
802 throws org.exolab.castor.xml.ValidationException {
803 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
804 validator.validate(this);