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