2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package uk.ac.vamsas.objects.core;
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 DataSet extends uk.ac.vamsas.client.Vobject
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * Primary Key for vamsas object referencing
34 private java.lang.String _id;
37 * Field _sequenceList.
39 private java.util.Vector _sequenceList;
42 * Field _sequenceMappingList.
44 private java.util.Vector _sequenceMappingList;
47 * Field _dataSetAnnotationsList.
49 private java.util.Vector _dataSetAnnotationsList;
52 * Field _alignmentList.
54 private java.util.Vector _alignmentList;
59 private java.util.Vector _treeList;
64 private uk.ac.vamsas.objects.core.Provenance _provenance;
73 this._sequenceList = new java.util.Vector();
74 this._sequenceMappingList = new java.util.Vector();
75 this._dataSetAnnotationsList = new java.util.Vector();
76 this._alignmentList = new java.util.Vector();
77 this._treeList = new java.util.Vector();
89 * @throws java.lang.IndexOutOfBoundsException if the index
90 * given is outside the bounds of the collection
92 public void addAlignment(
93 final uk.ac.vamsas.objects.core.Alignment vAlignment)
94 throws java.lang.IndexOutOfBoundsException {
95 this._alignmentList.addElement(vAlignment);
103 * @throws java.lang.IndexOutOfBoundsException if the index
104 * given is outside the bounds of the collection
106 public void addAlignment(
108 final uk.ac.vamsas.objects.core.Alignment vAlignment)
109 throws java.lang.IndexOutOfBoundsException {
110 this._alignmentList.add(index, vAlignment);
116 * @param vDataSetAnnotations
117 * @throws java.lang.IndexOutOfBoundsException if the index
118 * given is outside the bounds of the collection
120 public void addDataSetAnnotations(
121 final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
122 throws java.lang.IndexOutOfBoundsException {
123 this._dataSetAnnotationsList.addElement(vDataSetAnnotations);
130 * @param vDataSetAnnotations
131 * @throws java.lang.IndexOutOfBoundsException if the index
132 * given is outside the bounds of the collection
134 public void addDataSetAnnotations(
136 final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
137 throws java.lang.IndexOutOfBoundsException {
138 this._dataSetAnnotationsList.add(index, vDataSetAnnotations);
145 * @throws java.lang.IndexOutOfBoundsException if the index
146 * given is outside the bounds of the collection
148 public void addSequence(
149 final uk.ac.vamsas.objects.core.Sequence vSequence)
150 throws java.lang.IndexOutOfBoundsException {
151 this._sequenceList.addElement(vSequence);
159 * @throws java.lang.IndexOutOfBoundsException if the index
160 * given is outside the bounds of the collection
162 public void addSequence(
164 final uk.ac.vamsas.objects.core.Sequence vSequence)
165 throws java.lang.IndexOutOfBoundsException {
166 this._sequenceList.add(index, vSequence);
172 * @param vSequenceMapping
173 * @throws java.lang.IndexOutOfBoundsException if the index
174 * given is outside the bounds of the collection
176 public void addSequenceMapping(
177 final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
178 throws java.lang.IndexOutOfBoundsException {
179 this._sequenceMappingList.addElement(vSequenceMapping);
186 * @param vSequenceMapping
187 * @throws java.lang.IndexOutOfBoundsException if the index
188 * given is outside the bounds of the collection
190 public void addSequenceMapping(
192 final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
193 throws java.lang.IndexOutOfBoundsException {
194 this._sequenceMappingList.add(index, vSequenceMapping);
201 * @throws java.lang.IndexOutOfBoundsException if the index
202 * given is outside the bounds of the collection
205 final uk.ac.vamsas.objects.core.Tree vTree)
206 throws java.lang.IndexOutOfBoundsException {
207 this._treeList.addElement(vTree);
215 * @throws java.lang.IndexOutOfBoundsException if the index
216 * given is outside the bounds of the collection
220 final uk.ac.vamsas.objects.core.Tree vTree)
221 throws java.lang.IndexOutOfBoundsException {
222 this._treeList.add(index, vTree);
226 * Method enumerateAlignment.
228 * @return an Enumeration over all
229 * uk.ac.vamsas.objects.core.Alignment elements
231 public java.util.Enumeration enumerateAlignment(
233 return this._alignmentList.elements();
237 * Method enumerateDataSetAnnotations.
239 * @return an Enumeration over all
240 * uk.ac.vamsas.objects.core.DataSetAnnotations elements
242 public java.util.Enumeration enumerateDataSetAnnotations(
244 return this._dataSetAnnotationsList.elements();
248 * Method enumerateSequence.
250 * @return an Enumeration over all
251 * uk.ac.vamsas.objects.core.Sequence elements
253 public java.util.Enumeration enumerateSequence(
255 return this._sequenceList.elements();
259 * Method enumerateSequenceMapping.
261 * @return an Enumeration over all
262 * uk.ac.vamsas.objects.core.SequenceMapping elements
264 public java.util.Enumeration enumerateSequenceMapping(
266 return this._sequenceMappingList.elements();
270 * Method enumerateTree.
272 * @return an Enumeration over all
273 * uk.ac.vamsas.objects.core.Tree elements
275 public java.util.Enumeration enumerateTree(
277 return this._treeList.elements();
281 * Overrides the java.lang.Object.equals method.
284 * @return true if the objects are equal.
286 public boolean equals(
287 final java.lang.Object obj) {
291 if (super.equals(obj)==false)
294 if (obj instanceof DataSet) {
296 DataSet temp = (DataSet)obj;
299 if (this._id != null) {
300 if (temp._id == null) return false;
301 if (this._id != temp._id) {
302 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
303 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
304 if (thcycle!=tmcycle) {
305 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
306 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
310 if (!this._id.equals(temp._id)) {
311 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
312 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
315 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
316 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
319 } else if (temp._id != null)
321 if (this._sequenceList != null) {
322 if (temp._sequenceList == null) return false;
323 if (this._sequenceList != temp._sequenceList) {
324 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceList);
325 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceList);
326 if (thcycle!=tmcycle) {
327 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList); };
328 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList); };
332 if (!this._sequenceList.equals(temp._sequenceList)) {
333 org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
334 org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
337 org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
338 org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
341 } else if (temp._sequenceList != null)
343 if (this._sequenceMappingList != null) {
344 if (temp._sequenceMappingList == null) return false;
345 if (this._sequenceMappingList != temp._sequenceMappingList) {
346 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceMappingList);
347 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceMappingList);
348 if (thcycle!=tmcycle) {
349 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList); };
350 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList); };
354 if (!this._sequenceMappingList.equals(temp._sequenceMappingList)) {
355 org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList);
356 org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList);
359 org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList);
360 org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList);
363 } else if (temp._sequenceMappingList != null)
365 if (this._dataSetAnnotationsList != null) {
366 if (temp._dataSetAnnotationsList == null) return false;
367 if (this._dataSetAnnotationsList != temp._dataSetAnnotationsList) {
368 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataSetAnnotationsList);
369 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataSetAnnotationsList);
370 if (thcycle!=tmcycle) {
371 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList); };
372 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList); };
376 if (!this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)) {
377 org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList);
378 org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList);
381 org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList);
382 org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList);
385 } else if (temp._dataSetAnnotationsList != null)
387 if (this._alignmentList != null) {
388 if (temp._alignmentList == null) return false;
389 if (this._alignmentList != temp._alignmentList) {
390 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentList);
391 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentList);
392 if (thcycle!=tmcycle) {
393 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList); };
394 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList); };
398 if (!this._alignmentList.equals(temp._alignmentList)) {
399 org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList);
400 org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList);
403 org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList);
404 org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList);
407 } else if (temp._alignmentList != null)
409 if (this._treeList != null) {
410 if (temp._treeList == null) return false;
411 if (this._treeList != temp._treeList) {
412 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
413 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
414 if (thcycle!=tmcycle) {
415 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
416 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
420 if (!this._treeList.equals(temp._treeList)) {
421 org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
422 org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
425 org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
426 org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
429 } else if (temp._treeList != null)
431 if (this._provenance != null) {
432 if (temp._provenance == null) return false;
433 if (this._provenance != temp._provenance) {
434 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
435 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
436 if (thcycle!=tmcycle) {
437 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
438 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
442 if (!this._provenance.equals(temp._provenance)) {
443 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
444 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
447 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
448 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
451 } else if (temp._provenance != null)
459 * Method getAlignment.
462 * @throws java.lang.IndexOutOfBoundsException if the index
463 * given is outside the bounds of the collection
464 * @return the value of the uk.ac.vamsas.objects.core.Alignment
467 public uk.ac.vamsas.objects.core.Alignment getAlignment(
469 throws java.lang.IndexOutOfBoundsException {
470 // check bounds for index
471 if (index < 0 || index >= this._alignmentList.size()) {
472 throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
475 return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.get(index);
479 * Method getAlignment.Returns the contents of the collection
480 * in an Array. <p>Note: Just in case the collection contents
481 * are changing in another thread, we pass a 0-length Array of
482 * the correct type into the API call. This way we <i>know</i>
483 * that the Array returned is of exactly the correct length.
485 * @return this collection as an Array
487 public uk.ac.vamsas.objects.core.Alignment[] getAlignment(
489 uk.ac.vamsas.objects.core.Alignment[] array = new uk.ac.vamsas.objects.core.Alignment[0];
490 return (uk.ac.vamsas.objects.core.Alignment[]) this._alignmentList.toArray(array);
494 * Method getAlignmentAsReference.Returns a reference to
495 * '_alignmentList'. No type checking is performed on any
496 * modifications to the Vector.
498 * @return a reference to the Vector backing this class
500 public java.util.Vector getAlignmentAsReference(
502 return this._alignmentList;
506 * Method getAlignmentCount.
508 * @return the size of this collection
510 public int getAlignmentCount(
512 return this._alignmentList.size();
516 * Method getDataSetAnnotations.
519 * @throws java.lang.IndexOutOfBoundsException if the index
520 * given is outside the bounds of the collection
521 * @return the value of the
522 * uk.ac.vamsas.objects.core.DataSetAnnotations at the given
525 public uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(
527 throws java.lang.IndexOutOfBoundsException {
528 // check bounds for index
529 if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
530 throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]");
533 return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.get(index);
537 * Method getDataSetAnnotations.Returns the contents of the
538 * collection in an Array. <p>Note: Just in case the
539 * collection contents are changing in another thread, we pass
540 * a 0-length Array of the correct type into the API call.
541 * This way we <i>know</i> that the Array returned is of
542 * exactly the correct length.
544 * @return this collection as an Array
546 public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations(
548 uk.ac.vamsas.objects.core.DataSetAnnotations[] array = new uk.ac.vamsas.objects.core.DataSetAnnotations[0];
549 return (uk.ac.vamsas.objects.core.DataSetAnnotations[]) this._dataSetAnnotationsList.toArray(array);
553 * Method getDataSetAnnotationsAsReference.Returns a reference
554 * to '_dataSetAnnotationsList'. No type checking is performed
555 * on any modifications to the Vector.
557 * @return a reference to the Vector backing this class
559 public java.util.Vector getDataSetAnnotationsAsReference(
561 return this._dataSetAnnotationsList;
565 * Method getDataSetAnnotationsCount.
567 * @return the size of this collection
569 public int getDataSetAnnotationsCount(
571 return this._dataSetAnnotationsList.size();
575 * Returns the value of field 'id'. The field 'id' has the
576 * following description: Primary Key for vamsas object
579 * @return the value of field 'Id'.
581 public java.lang.String getId(
587 * Returns the value of field 'provenance'.
589 * @return the value of field 'Provenance'.
591 public uk.ac.vamsas.objects.core.Provenance getProvenance(
593 return this._provenance;
597 * Method getSequence.
600 * @throws java.lang.IndexOutOfBoundsException if the index
601 * given is outside the bounds of the collection
602 * @return the value of the uk.ac.vamsas.objects.core.Sequence
605 public uk.ac.vamsas.objects.core.Sequence getSequence(
607 throws java.lang.IndexOutOfBoundsException {
608 // check bounds for index
609 if (index < 0 || index >= this._sequenceList.size()) {
610 throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
613 return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.get(index);
617 * Method getSequence.Returns the contents of the collection in
618 * an Array. <p>Note: Just in case the collection contents
619 * are changing in another thread, we pass a 0-length Array of
620 * the correct type into the API call. This way we <i>know</i>
621 * that the Array returned is of exactly the correct length.
623 * @return this collection as an Array
625 public uk.ac.vamsas.objects.core.Sequence[] getSequence(
627 uk.ac.vamsas.objects.core.Sequence[] array = new uk.ac.vamsas.objects.core.Sequence[0];
628 return (uk.ac.vamsas.objects.core.Sequence[]) this._sequenceList.toArray(array);
632 * Method getSequenceAsReference.Returns a reference to
633 * '_sequenceList'. No type checking is performed on any
634 * modifications to the Vector.
636 * @return a reference to the Vector backing this class
638 public java.util.Vector getSequenceAsReference(
640 return this._sequenceList;
644 * Method getSequenceCount.
646 * @return the size of this collection
648 public int getSequenceCount(
650 return this._sequenceList.size();
654 * Method getSequenceMapping.
657 * @throws java.lang.IndexOutOfBoundsException if the index
658 * given is outside the bounds of the collection
659 * @return the value of the
660 * uk.ac.vamsas.objects.core.SequenceMapping at the given index
662 public uk.ac.vamsas.objects.core.SequenceMapping getSequenceMapping(
664 throws java.lang.IndexOutOfBoundsException {
665 // check bounds for index
666 if (index < 0 || index >= this._sequenceMappingList.size()) {
667 throw new IndexOutOfBoundsException("getSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]");
670 return (uk.ac.vamsas.objects.core.SequenceMapping) _sequenceMappingList.get(index);
674 * Method getSequenceMapping.Returns the contents of the
675 * collection in an Array. <p>Note: Just in case the
676 * collection contents are changing in another thread, we pass
677 * a 0-length Array of the correct type into the API call.
678 * This way we <i>know</i> that the Array returned is of
679 * exactly the correct length.
681 * @return this collection as an Array
683 public uk.ac.vamsas.objects.core.SequenceMapping[] getSequenceMapping(
685 uk.ac.vamsas.objects.core.SequenceMapping[] array = new uk.ac.vamsas.objects.core.SequenceMapping[0];
686 return (uk.ac.vamsas.objects.core.SequenceMapping[]) this._sequenceMappingList.toArray(array);
690 * Method getSequenceMappingAsReference.Returns a reference to
691 * '_sequenceMappingList'. No type checking is performed on any
692 * modifications to the Vector.
694 * @return a reference to the Vector backing this class
696 public java.util.Vector getSequenceMappingAsReference(
698 return this._sequenceMappingList;
702 * Method getSequenceMappingCount.
704 * @return the size of this collection
706 public int getSequenceMappingCount(
708 return this._sequenceMappingList.size();
715 * @throws java.lang.IndexOutOfBoundsException if the index
716 * given is outside the bounds of the collection
717 * @return the value of the uk.ac.vamsas.objects.core.Tree at
720 public uk.ac.vamsas.objects.core.Tree getTree(
722 throws java.lang.IndexOutOfBoundsException {
723 // check bounds for index
724 if (index < 0 || index >= this._treeList.size()) {
725 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
728 return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
732 * Method getTree.Returns the contents of the collection in an
733 * Array. <p>Note: Just in case the collection contents are
734 * changing in another thread, we pass a 0-length Array of the
735 * correct type into the API call. This way we <i>know</i>
736 * that the Array returned is of exactly the correct length.
738 * @return this collection as an Array
740 public uk.ac.vamsas.objects.core.Tree[] getTree(
742 uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
743 return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
747 * Method getTreeAsReference.Returns a reference to
748 * '_treeList'. No type checking is performed on any
749 * modifications to the Vector.
751 * @return a reference to the Vector backing this class
753 public java.util.Vector getTreeAsReference(
755 return this._treeList;
759 * Method getTreeCount.
761 * @return the size of this collection
763 public int getTreeCount(
765 return this._treeList.size();
769 * Overrides the java.lang.Object.hashCode method.
771 * The following steps came from <b>Effective Java Programming
772 * Language Guide</b> by Joshua Bloch, Chapter 3
774 * @return a hash code value for the object.
778 int result = super.hashCode();
782 && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
783 result = 37 * result + _id.hashCode();
784 org.castor.util.CycleBreaker.releaseCycleHandle(_id);
786 if (_sequenceList != null
787 && !org.castor.util.CycleBreaker.startingToCycle(_sequenceList)) {
788 result = 37 * result + _sequenceList.hashCode();
789 org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceList);
791 if (_sequenceMappingList != null
792 && !org.castor.util.CycleBreaker.startingToCycle(_sequenceMappingList)) {
793 result = 37 * result + _sequenceMappingList.hashCode();
794 org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceMappingList);
796 if (_dataSetAnnotationsList != null
797 && !org.castor.util.CycleBreaker.startingToCycle(_dataSetAnnotationsList)) {
798 result = 37 * result + _dataSetAnnotationsList.hashCode();
799 org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetAnnotationsList);
801 if (_alignmentList != null
802 && !org.castor.util.CycleBreaker.startingToCycle(_alignmentList)) {
803 result = 37 * result + _alignmentList.hashCode();
804 org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentList);
806 if (_treeList != null
807 && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
808 result = 37 * result + _treeList.hashCode();
809 org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
811 if (_provenance != null
812 && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
813 result = 37 * result + _provenance.hashCode();
814 org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
823 * @return true if this object is valid according to the schema
825 public boolean isValid(
829 } catch (org.exolab.castor.xml.ValidationException vex) {
839 * @throws org.exolab.castor.xml.MarshalException if object is
840 * null or if any SAXException is thrown during marshaling
841 * @throws org.exolab.castor.xml.ValidationException if this
842 * object is an invalid instance according to the schema
845 final java.io.Writer out)
846 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
847 Marshaller.marshal(this, out);
854 * @throws java.io.IOException if an IOException occurs during
856 * @throws org.exolab.castor.xml.ValidationException if this
857 * object is an invalid instance according to the schema
858 * @throws org.exolab.castor.xml.MarshalException if object is
859 * null or if any SAXException is thrown during marshaling
862 final org.xml.sax.ContentHandler handler)
863 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
864 Marshaller.marshal(this, handler);
868 * Method removeAlignment.
871 * @return true if the object was removed from the collection.
873 public boolean removeAlignment(
874 final uk.ac.vamsas.objects.core.Alignment vAlignment) {
875 boolean removed = _alignmentList.remove(vAlignment);
880 * Method removeAlignmentAt.
883 * @return the element removed from the collection
885 public uk.ac.vamsas.objects.core.Alignment removeAlignmentAt(
887 java.lang.Object obj = this._alignmentList.remove(index);
888 return (uk.ac.vamsas.objects.core.Alignment) obj;
893 public void removeAllAlignment(
895 this._alignmentList.clear();
900 public void removeAllDataSetAnnotations(
902 this._dataSetAnnotationsList.clear();
907 public void removeAllSequence(
909 this._sequenceList.clear();
914 public void removeAllSequenceMapping(
916 this._sequenceMappingList.clear();
921 public void removeAllTree(
923 this._treeList.clear();
927 * Method removeDataSetAnnotations.
929 * @param vDataSetAnnotations
930 * @return true if the object was removed from the collection.
932 public boolean removeDataSetAnnotations(
933 final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) {
934 boolean removed = _dataSetAnnotationsList.remove(vDataSetAnnotations);
939 * Method removeDataSetAnnotationsAt.
942 * @return the element removed from the collection
944 public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotationsAt(
946 java.lang.Object obj = this._dataSetAnnotationsList.remove(index);
947 return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj;
951 * Method removeSequence.
954 * @return true if the object was removed from the collection.
956 public boolean removeSequence(
957 final uk.ac.vamsas.objects.core.Sequence vSequence) {
958 boolean removed = _sequenceList.remove(vSequence);
963 * Method removeSequenceAt.
966 * @return the element removed from the collection
968 public uk.ac.vamsas.objects.core.Sequence removeSequenceAt(
970 java.lang.Object obj = this._sequenceList.remove(index);
971 return (uk.ac.vamsas.objects.core.Sequence) obj;
975 * Method removeSequenceMapping.
977 * @param vSequenceMapping
978 * @return true if the object was removed from the collection.
980 public boolean removeSequenceMapping(
981 final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) {
982 boolean removed = _sequenceMappingList.remove(vSequenceMapping);
987 * Method removeSequenceMappingAt.
990 * @return the element removed from the collection
992 public uk.ac.vamsas.objects.core.SequenceMapping removeSequenceMappingAt(
994 java.lang.Object obj = this._sequenceMappingList.remove(index);
995 return (uk.ac.vamsas.objects.core.SequenceMapping) obj;
1002 * @return true if the object was removed from the collection.
1004 public boolean removeTree(
1005 final uk.ac.vamsas.objects.core.Tree vTree) {
1006 boolean removed = _treeList.remove(vTree);
1011 * Method removeTreeAt.
1014 * @return the element removed from the collection
1016 public uk.ac.vamsas.objects.core.Tree removeTreeAt(
1018 java.lang.Object obj = this._treeList.remove(index);
1019 return (uk.ac.vamsas.objects.core.Tree) obj;
1027 * @throws java.lang.IndexOutOfBoundsException if the index
1028 * given is outside the bounds of the collection
1030 public void setAlignment(
1032 final uk.ac.vamsas.objects.core.Alignment vAlignment)
1033 throws java.lang.IndexOutOfBoundsException {
1034 // check bounds for index
1035 if (index < 0 || index >= this._alignmentList.size()) {
1036 throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
1039 this._alignmentList.set(index, vAlignment);
1045 * @param vAlignmentArray
1047 public void setAlignment(
1048 final uk.ac.vamsas.objects.core.Alignment[] vAlignmentArray) {
1050 _alignmentList.clear();
1052 for (int i = 0; i < vAlignmentArray.length; i++) {
1053 this._alignmentList.add(vAlignmentArray[i]);
1058 * Sets the value of '_alignmentList' by copying the given
1059 * Vector. All elements will be checked for type safety.
1061 * @param vAlignmentList the Vector to copy.
1063 public void setAlignment(
1064 final java.util.Vector vAlignmentList) {
1066 this._alignmentList.clear();
1068 this._alignmentList.addAll(vAlignmentList);
1072 * Sets the value of '_alignmentList' by setting it to the
1073 * given Vector. No type checking is performed.
1076 * @param alignmentVector the Vector to set.
1078 public void setAlignmentAsReference(
1079 final java.util.Vector alignmentVector) {
1080 this._alignmentList = alignmentVector;
1087 * @param vDataSetAnnotations
1088 * @throws java.lang.IndexOutOfBoundsException if the index
1089 * given is outside the bounds of the collection
1091 public void setDataSetAnnotations(
1093 final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
1094 throws java.lang.IndexOutOfBoundsException {
1095 // check bounds for index
1096 if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
1097 throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]");
1100 this._dataSetAnnotationsList.set(index, vDataSetAnnotations);
1106 * @param vDataSetAnnotationsArray
1108 public void setDataSetAnnotations(
1109 final uk.ac.vamsas.objects.core.DataSetAnnotations[] vDataSetAnnotationsArray) {
1111 _dataSetAnnotationsList.clear();
1113 for (int i = 0; i < vDataSetAnnotationsArray.length; i++) {
1114 this._dataSetAnnotationsList.add(vDataSetAnnotationsArray[i]);
1119 * Sets the value of '_dataSetAnnotationsList' by copying the
1120 * given Vector. All elements will be checked for type safety.
1122 * @param vDataSetAnnotationsList the Vector to copy.
1124 public void setDataSetAnnotations(
1125 final java.util.Vector vDataSetAnnotationsList) {
1127 this._dataSetAnnotationsList.clear();
1129 this._dataSetAnnotationsList.addAll(vDataSetAnnotationsList);
1133 * Sets the value of '_dataSetAnnotationsList' by setting it to
1134 * the given Vector. No type checking is performed.
1137 * @param dataSetAnnotationsVector the Vector to set.
1139 public void setDataSetAnnotationsAsReference(
1140 final java.util.Vector dataSetAnnotationsVector) {
1141 this._dataSetAnnotationsList = dataSetAnnotationsVector;
1145 * Sets the value of field 'id'. The field 'id' has the
1146 * following description: Primary Key for vamsas object
1149 * @param id the value of field 'id'.
1152 final java.lang.String id) {
1157 * Sets the value of field 'provenance'.
1159 * @param provenance the value of field 'provenance'.
1161 public void setProvenance(
1162 final uk.ac.vamsas.objects.core.Provenance provenance) {
1163 this._provenance = provenance;
1171 * @throws java.lang.IndexOutOfBoundsException if the index
1172 * given is outside the bounds of the collection
1174 public void setSequence(
1176 final uk.ac.vamsas.objects.core.Sequence vSequence)
1177 throws java.lang.IndexOutOfBoundsException {
1178 // check bounds for index
1179 if (index < 0 || index >= this._sequenceList.size()) {
1180 throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
1183 this._sequenceList.set(index, vSequence);
1189 * @param vSequenceArray
1191 public void setSequence(
1192 final uk.ac.vamsas.objects.core.Sequence[] vSequenceArray) {
1194 _sequenceList.clear();
1196 for (int i = 0; i < vSequenceArray.length; i++) {
1197 this._sequenceList.add(vSequenceArray[i]);
1202 * Sets the value of '_sequenceList' by copying the given
1203 * Vector. All elements will be checked for type safety.
1205 * @param vSequenceList the Vector to copy.
1207 public void setSequence(
1208 final java.util.Vector vSequenceList) {
1210 this._sequenceList.clear();
1212 this._sequenceList.addAll(vSequenceList);
1216 * Sets the value of '_sequenceList' by setting it to the given
1217 * Vector. No type checking is performed.
1220 * @param sequenceVector the Vector to set.
1222 public void setSequenceAsReference(
1223 final java.util.Vector sequenceVector) {
1224 this._sequenceList = sequenceVector;
1231 * @param vSequenceMapping
1232 * @throws java.lang.IndexOutOfBoundsException if the index
1233 * given is outside the bounds of the collection
1235 public void setSequenceMapping(
1237 final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
1238 throws java.lang.IndexOutOfBoundsException {
1239 // check bounds for index
1240 if (index < 0 || index >= this._sequenceMappingList.size()) {
1241 throw new IndexOutOfBoundsException("setSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]");
1244 this._sequenceMappingList.set(index, vSequenceMapping);
1250 * @param vSequenceMappingArray
1252 public void setSequenceMapping(
1253 final uk.ac.vamsas.objects.core.SequenceMapping[] vSequenceMappingArray) {
1255 _sequenceMappingList.clear();
1257 for (int i = 0; i < vSequenceMappingArray.length; i++) {
1258 this._sequenceMappingList.add(vSequenceMappingArray[i]);
1263 * Sets the value of '_sequenceMappingList' by copying the
1264 * given Vector. All elements will be checked for type safety.
1266 * @param vSequenceMappingList the Vector to copy.
1268 public void setSequenceMapping(
1269 final java.util.Vector vSequenceMappingList) {
1271 this._sequenceMappingList.clear();
1273 this._sequenceMappingList.addAll(vSequenceMappingList);
1277 * Sets the value of '_sequenceMappingList' by setting it to
1278 * the given Vector. No type checking is performed.
1281 * @param sequenceMappingVector the Vector to set.
1283 public void setSequenceMappingAsReference(
1284 final java.util.Vector sequenceMappingVector) {
1285 this._sequenceMappingList = sequenceMappingVector;
1293 * @throws java.lang.IndexOutOfBoundsException if the index
1294 * given is outside the bounds of the collection
1296 public void setTree(
1298 final uk.ac.vamsas.objects.core.Tree vTree)
1299 throws java.lang.IndexOutOfBoundsException {
1300 // check bounds for index
1301 if (index < 0 || index >= this._treeList.size()) {
1302 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
1305 this._treeList.set(index, vTree);
1313 public void setTree(
1314 final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
1318 for (int i = 0; i < vTreeArray.length; i++) {
1319 this._treeList.add(vTreeArray[i]);
1324 * Sets the value of '_treeList' by copying the given Vector.
1325 * All elements will be checked for type safety.
1327 * @param vTreeList the Vector to copy.
1329 public void setTree(
1330 final java.util.Vector vTreeList) {
1332 this._treeList.clear();
1334 this._treeList.addAll(vTreeList);
1338 * Sets the value of '_treeList' by setting it to the given
1339 * Vector. No type checking is performed.
1342 * @param treeVector the Vector to set.
1344 public void setTreeAsReference(
1345 final java.util.Vector treeVector) {
1346 this._treeList = treeVector;
1353 * @throws org.exolab.castor.xml.MarshalException if object is
1354 * null or if any SAXException is thrown during marshaling
1355 * @throws org.exolab.castor.xml.ValidationException if this
1356 * object is an invalid instance according to the schema
1357 * @return the unmarshaled uk.ac.vamsas.objects.core.DataSet
1359 public static uk.ac.vamsas.objects.core.DataSet unmarshal(
1360 final java.io.Reader reader)
1361 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1362 return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSet.class, reader);
1368 * @throws org.exolab.castor.xml.ValidationException if this
1369 * object is an invalid instance according to the schema
1371 public void validate(
1373 throws org.exolab.castor.xml.ValidationException {
1374 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1375 validator.validate(this);