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 sequences for all
36 * 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;
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();
81 * @param vAlcodonFrame
82 * @throws java.lang.IndexOutOfBoundsException
83 * if the index given is outside the bounds of the collection
85 public void addAlcodonFrame(
86 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
87 throws java.lang.IndexOutOfBoundsException
89 this._alcodonFrameList.addElement(vAlcodonFrame);
96 * @param vAlcodonFrame
97 * @throws java.lang.IndexOutOfBoundsException
98 * if the index given is outside the bounds of the collection
100 public void addAlcodonFrame(final int index,
101 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
102 throws java.lang.IndexOutOfBoundsException
104 this._alcodonFrameList.add(index, vAlcodonFrame);
111 * @throws java.lang.IndexOutOfBoundsException
112 * if the index given is outside the bounds of the collection
114 public void addAnnotation(
115 final jalview.schemabinding.version2.Annotation vAnnotation)
116 throws java.lang.IndexOutOfBoundsException
118 this._annotationList.addElement(vAnnotation);
126 * @throws java.lang.IndexOutOfBoundsException
127 * if the index given is outside the bounds of the collection
129 public void addAnnotation(final int index,
130 final jalview.schemabinding.version2.Annotation vAnnotation)
131 throws java.lang.IndexOutOfBoundsException
133 this._annotationList.add(index, vAnnotation);
140 * @throws java.lang.IndexOutOfBoundsException
141 * if the index given is outside the bounds of the collection
143 public void addSequence(
144 final jalview.schemabinding.version2.Sequence vSequence)
145 throws java.lang.IndexOutOfBoundsException
147 this._sequenceList.addElement(vSequence);
155 * @throws java.lang.IndexOutOfBoundsException
156 * if the index given is outside the bounds of the collection
158 public void addSequence(final int index,
159 final jalview.schemabinding.version2.Sequence vSequence)
160 throws java.lang.IndexOutOfBoundsException
162 this._sequenceList.add(index, vSequence);
168 * @param vSequenceSetProperties
169 * @throws java.lang.IndexOutOfBoundsException
170 * if the index given is outside the bounds of the collection
172 public void addSequenceSetProperties(
173 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
174 throws java.lang.IndexOutOfBoundsException
176 this._sequenceSetPropertiesList.addElement(vSequenceSetProperties);
183 * @param vSequenceSetProperties
184 * @throws java.lang.IndexOutOfBoundsException
185 * if the index given is outside the bounds of the collection
187 public void addSequenceSetProperties(
189 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
190 throws java.lang.IndexOutOfBoundsException
192 this._sequenceSetPropertiesList.add(index, vSequenceSetProperties);
196 * Method enumerateAlcodonFrame.
198 * @return an Enumeration over all jalview.schemabinding.version2.AlcodonFrame
201 public java.util.Enumeration enumerateAlcodonFrame()
203 return this._alcodonFrameList.elements();
207 * Method enumerateAnnotation.
209 * @return an Enumeration over all jalview.schemabinding.version2.Annotation
212 public java.util.Enumeration enumerateAnnotation()
214 return this._annotationList.elements();
218 * Method enumerateSequence.
220 * @return an Enumeration over all jalview.schemabinding.version2.Sequence
223 public java.util.Enumeration enumerateSequence()
225 return this._sequenceList.elements();
229 * Method enumerateSequenceSetProperties.
231 * @return an Enumeration over all
232 * jalview.schemabinding.version2.SequenceSetProperties elements
234 public java.util.Enumeration enumerateSequenceSetProperties()
236 return this._sequenceSetPropertiesList.elements();
240 * Method getAlcodonFrame.
243 * @throws java.lang.IndexOutOfBoundsException
244 * if the index given is outside the bounds of the collection
245 * @return the value of the jalview.schemabinding.version2.AlcodonFrame at the
248 public jalview.schemabinding.version2.AlcodonFrame getAlcodonFrame(
249 final int index) throws java.lang.IndexOutOfBoundsException
251 // check bounds for index
252 if (index < 0 || index >= this._alcodonFrameList.size())
254 throw new IndexOutOfBoundsException("getAlcodonFrame: Index value '"
255 + index + "' not in range [0.."
256 + (this._alcodonFrameList.size() - 1) + "]");
259 return (jalview.schemabinding.version2.AlcodonFrame) _alcodonFrameList
264 * Method getAlcodonFrame.Returns the contents of the collection in an Array.
266 * Note: Just in case the collection contents are changing in another thread,
267 * we pass a 0-length Array of the correct type into the API call. This way we
268 * <i>know</i> that the Array returned is of exactly the correct length.
270 * @return this collection as an Array
272 public jalview.schemabinding.version2.AlcodonFrame[] getAlcodonFrame()
274 jalview.schemabinding.version2.AlcodonFrame[] array = new jalview.schemabinding.version2.AlcodonFrame[0];
275 return (jalview.schemabinding.version2.AlcodonFrame[]) this._alcodonFrameList
280 * Method getAlcodonFrameCount.
282 * @return the size of this collection
284 public int getAlcodonFrameCount()
286 return this._alcodonFrameList.size();
290 * Method getAnnotation.
293 * @throws java.lang.IndexOutOfBoundsException
294 * if the index given is outside the bounds of the collection
295 * @return the value of the jalview.schemabinding.version2.Annotation at the
298 public jalview.schemabinding.version2.Annotation getAnnotation(
299 final int index) throws java.lang.IndexOutOfBoundsException
301 // check bounds for index
302 if (index < 0 || index >= this._annotationList.size())
304 throw new IndexOutOfBoundsException("getAnnotation: Index value '"
305 + index + "' not in range [0.."
306 + (this._annotationList.size() - 1) + "]");
309 return (jalview.schemabinding.version2.Annotation) _annotationList
314 * Method getAnnotation.Returns the contents of the collection in an Array.
316 * Note: Just in case the collection contents are changing in another thread,
317 * we pass a 0-length Array of the correct type into the API call. This way we
318 * <i>know</i> that the Array returned is of exactly the correct length.
320 * @return this collection as an Array
322 public jalview.schemabinding.version2.Annotation[] getAnnotation()
324 jalview.schemabinding.version2.Annotation[] array = new jalview.schemabinding.version2.Annotation[0];
325 return (jalview.schemabinding.version2.Annotation[]) this._annotationList
330 * Method getAnnotationCount.
332 * @return the size of this collection
334 public int getAnnotationCount()
336 return this._annotationList.size();
340 * Returns the value of field 'datasetId'. The field 'datasetId' has the
341 * following description: reference to set where jalview will gather the
342 * dataset sequences for all sequences in the set.
345 * @return the value of field 'DatasetId'.
347 public java.lang.String getDatasetId()
349 return this._datasetId;
353 * Returns the value of field 'gapChar'.
355 * @return the value of field 'GapChar'.
357 public java.lang.String getGapChar()
359 return this._gapChar;
363 * Method getSequence.
366 * @throws java.lang.IndexOutOfBoundsException
367 * if the index given is outside the bounds of the collection
368 * @return the value of the jalview.schemabinding.version2.Sequence at the
371 public jalview.schemabinding.version2.Sequence getSequence(final int index)
372 throws java.lang.IndexOutOfBoundsException
374 // check bounds for index
375 if (index < 0 || index >= this._sequenceList.size())
377 throw new IndexOutOfBoundsException("getSequence: Index value '"
378 + index + "' not in range [0.."
379 + (this._sequenceList.size() - 1) + "]");
382 return (jalview.schemabinding.version2.Sequence) _sequenceList
387 * Method getSequence.Returns the contents of the collection in an Array.
389 * Note: Just in case the collection contents are changing in another thread,
390 * we pass a 0-length Array of the correct type into the API call. This way we
391 * <i>know</i> that the Array returned is of exactly the correct length.
393 * @return this collection as an Array
395 public jalview.schemabinding.version2.Sequence[] getSequence()
397 jalview.schemabinding.version2.Sequence[] array = new jalview.schemabinding.version2.Sequence[0];
398 return (jalview.schemabinding.version2.Sequence[]) this._sequenceList
403 * Method getSequenceCount.
405 * @return the size of this collection
407 public int getSequenceCount()
409 return this._sequenceList.size();
413 * Method getSequenceSetProperties.
416 * @throws java.lang.IndexOutOfBoundsException
417 * if the index given is outside the bounds of the collection
418 * @return the value of the
419 * jalview.schemabinding.version2.SequenceSetProperties at the given
422 public jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties(
423 final int index) throws java.lang.IndexOutOfBoundsException
425 // check bounds for index
426 if (index < 0 || index >= this._sequenceSetPropertiesList.size())
428 throw new IndexOutOfBoundsException(
429 "getSequenceSetProperties: Index value '" + index
430 + "' not in range [0.."
431 + (this._sequenceSetPropertiesList.size() - 1) + "]");
434 return (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList
439 * Method getSequenceSetProperties.Returns the contents of the collection in
442 * Note: Just in case the collection contents are changing in another thread,
443 * we pass a 0-length Array of the correct type into the API call. This way we
444 * <i>know</i> that the Array returned is of exactly the correct length.
446 * @return this collection as an Array
448 public jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties()
450 jalview.schemabinding.version2.SequenceSetProperties[] array = new jalview.schemabinding.version2.SequenceSetProperties[0];
451 return (jalview.schemabinding.version2.SequenceSetProperties[]) this._sequenceSetPropertiesList
456 * Method getSequenceSetPropertiesCount.
458 * @return the size of this collection
460 public int getSequenceSetPropertiesCount()
462 return this._sequenceSetPropertiesList.size();
468 * @return true if this object is valid according to the schema
470 public boolean isValid()
475 } catch (org.exolab.castor.xml.ValidationException vex)
486 * @throws org.exolab.castor.xml.MarshalException
487 * if object is null or if any SAXException is thrown during
489 * @throws org.exolab.castor.xml.ValidationException
490 * if this object is an invalid instance according to the schema
492 public void marshal(final java.io.Writer out)
493 throws org.exolab.castor.xml.MarshalException,
494 org.exolab.castor.xml.ValidationException
496 Marshaller.marshal(this, out);
503 * @throws java.io.IOException
504 * if an IOException occurs during marshaling
505 * @throws org.exolab.castor.xml.ValidationException
506 * if this object is an invalid instance according to the schema
507 * @throws org.exolab.castor.xml.MarshalException
508 * if object is null or if any SAXException is thrown during
511 public void marshal(final org.xml.sax.ContentHandler handler)
512 throws java.io.IOException,
513 org.exolab.castor.xml.MarshalException,
514 org.exolab.castor.xml.ValidationException
516 Marshaller.marshal(this, handler);
520 * Method removeAlcodonFrame.
522 * @param vAlcodonFrame
523 * @return true if the object was removed from the collection.
525 public boolean removeAlcodonFrame(
526 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
528 boolean removed = _alcodonFrameList.remove(vAlcodonFrame);
533 * Method removeAlcodonFrameAt.
536 * @return the element removed from the collection
538 public jalview.schemabinding.version2.AlcodonFrame removeAlcodonFrameAt(
541 java.lang.Object obj = this._alcodonFrameList.remove(index);
542 return (jalview.schemabinding.version2.AlcodonFrame) obj;
547 public void removeAllAlcodonFrame()
549 this._alcodonFrameList.clear();
554 public void removeAllAnnotation()
556 this._annotationList.clear();
561 public void removeAllSequence()
563 this._sequenceList.clear();
568 public void removeAllSequenceSetProperties()
570 this._sequenceSetPropertiesList.clear();
574 * Method removeAnnotation.
577 * @return true if the object was removed from the collection.
579 public boolean removeAnnotation(
580 final jalview.schemabinding.version2.Annotation vAnnotation)
582 boolean removed = _annotationList.remove(vAnnotation);
587 * Method removeAnnotationAt.
590 * @return the element removed from the collection
592 public jalview.schemabinding.version2.Annotation removeAnnotationAt(
595 java.lang.Object obj = this._annotationList.remove(index);
596 return (jalview.schemabinding.version2.Annotation) obj;
600 * Method removeSequence.
603 * @return true if the object was removed from the collection.
605 public boolean removeSequence(
606 final jalview.schemabinding.version2.Sequence vSequence)
608 boolean removed = _sequenceList.remove(vSequence);
613 * Method removeSequenceAt.
616 * @return the element removed from the collection
618 public jalview.schemabinding.version2.Sequence removeSequenceAt(
621 java.lang.Object obj = this._sequenceList.remove(index);
622 return (jalview.schemabinding.version2.Sequence) obj;
626 * Method removeSequenceSetProperties.
628 * @param vSequenceSetProperties
629 * @return true if the object was removed from the collection.
631 public boolean removeSequenceSetProperties(
632 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
634 boolean removed = _sequenceSetPropertiesList
635 .remove(vSequenceSetProperties);
640 * Method removeSequenceSetPropertiesAt.
643 * @return the element removed from the collection
645 public jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetPropertiesAt(
648 java.lang.Object obj = this._sequenceSetPropertiesList.remove(index);
649 return (jalview.schemabinding.version2.SequenceSetProperties) obj;
656 * @param vAlcodonFrame
657 * @throws java.lang.IndexOutOfBoundsException
658 * if the index given is outside the bounds of the collection
660 public void setAlcodonFrame(final int index,
661 final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame)
662 throws java.lang.IndexOutOfBoundsException
664 // check bounds for index
665 if (index < 0 || index >= this._alcodonFrameList.size())
667 throw new IndexOutOfBoundsException("setAlcodonFrame: Index value '"
668 + index + "' not in range [0.."
669 + (this._alcodonFrameList.size() - 1) + "]");
672 this._alcodonFrameList.set(index, vAlcodonFrame);
678 * @param vAlcodonFrameArray
680 public void setAlcodonFrame(
681 final jalview.schemabinding.version2.AlcodonFrame[] vAlcodonFrameArray)
684 _alcodonFrameList.clear();
686 for (int i = 0; i < vAlcodonFrameArray.length; i++)
688 this._alcodonFrameList.add(vAlcodonFrameArray[i]);
697 * @throws java.lang.IndexOutOfBoundsException
698 * if the index given is outside the bounds of the collection
700 public void setAnnotation(final int index,
701 final jalview.schemabinding.version2.Annotation vAnnotation)
702 throws java.lang.IndexOutOfBoundsException
704 // check bounds for index
705 if (index < 0 || index >= this._annotationList.size())
707 throw new IndexOutOfBoundsException("setAnnotation: Index value '"
708 + index + "' not in range [0.."
709 + (this._annotationList.size() - 1) + "]");
712 this._annotationList.set(index, vAnnotation);
718 * @param vAnnotationArray
720 public void setAnnotation(
721 final jalview.schemabinding.version2.Annotation[] vAnnotationArray)
724 _annotationList.clear();
726 for (int i = 0; i < vAnnotationArray.length; i++)
728 this._annotationList.add(vAnnotationArray[i]);
733 * Sets the value of field 'datasetId'. The field 'datasetId' has the
734 * following description: reference to set where jalview will gather the
735 * dataset sequences for all sequences in the set.
739 * the value of field 'datasetId'.
741 public void setDatasetId(final java.lang.String datasetId)
743 this._datasetId = datasetId;
747 * Sets the value of field 'gapChar'.
750 * the value of field 'gapChar'.
752 public void setGapChar(final java.lang.String gapChar)
754 this._gapChar = gapChar;
762 * @throws java.lang.IndexOutOfBoundsException
763 * if the index given is outside the bounds of the collection
765 public void setSequence(final int index,
766 final jalview.schemabinding.version2.Sequence vSequence)
767 throws java.lang.IndexOutOfBoundsException
769 // check bounds for index
770 if (index < 0 || index >= this._sequenceList.size())
772 throw new IndexOutOfBoundsException("setSequence: Index value '"
773 + index + "' not in range [0.."
774 + (this._sequenceList.size() - 1) + "]");
777 this._sequenceList.set(index, vSequence);
783 * @param vSequenceArray
785 public void setSequence(
786 final jalview.schemabinding.version2.Sequence[] vSequenceArray)
789 _sequenceList.clear();
791 for (int i = 0; i < vSequenceArray.length; i++)
793 this._sequenceList.add(vSequenceArray[i]);
801 * @param vSequenceSetProperties
802 * @throws java.lang.IndexOutOfBoundsException
803 * if the index given is outside the bounds of the collection
805 public void setSequenceSetProperties(
807 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
808 throws java.lang.IndexOutOfBoundsException
810 // check bounds for index
811 if (index < 0 || index >= this._sequenceSetPropertiesList.size())
813 throw new IndexOutOfBoundsException(
814 "setSequenceSetProperties: Index value '" + index
815 + "' not in range [0.."
816 + (this._sequenceSetPropertiesList.size() - 1) + "]");
819 this._sequenceSetPropertiesList.set(index, vSequenceSetProperties);
825 * @param vSequenceSetPropertiesArray
827 public void setSequenceSetProperties(
828 final jalview.schemabinding.version2.SequenceSetProperties[] vSequenceSetPropertiesArray)
831 _sequenceSetPropertiesList.clear();
833 for (int i = 0; i < vSequenceSetPropertiesArray.length; i++)
835 this._sequenceSetPropertiesList.add(vSequenceSetPropertiesArray[i]);
843 * @throws org.exolab.castor.xml.MarshalException
844 * if object is null or if any SAXException is thrown during
846 * @throws org.exolab.castor.xml.ValidationException
847 * if this object is an invalid instance according to the schema
848 * @return the unmarshaled jalview.schemabinding.version2.SequenceSet
850 public static jalview.schemabinding.version2.SequenceSet unmarshal(
851 final java.io.Reader reader)
852 throws org.exolab.castor.xml.MarshalException,
853 org.exolab.castor.xml.ValidationException
855 return (jalview.schemabinding.version2.SequenceSet) Unmarshaller
856 .unmarshal(jalview.schemabinding.version2.SequenceSet.class,
863 * @throws org.exolab.castor.xml.ValidationException
864 * if this object is an invalid instance according to the schema
866 public void validate() throws org.exolab.castor.xml.ValidationException
868 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
869 validator.validate(this);