2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
29 * @version $Revision$ $Date$
31 public class DataSet extends org.vamsas.client.Vobject
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
41 * Primary Key for vamsas object referencing
44 private java.lang.String _id;
49 private java.util.Vector _sequenceList;
52 * Field _dataSetAnnotationsList
54 private java.util.Vector _dataSetAnnotationsList;
57 * Field _alignmentList
59 private java.util.Vector _alignmentList;
64 private java.util.Vector _treeList;
69 private org.vamsas.objects.core.Provenance _provenance;
79 _sequenceList = new Vector();
80 _dataSetAnnotationsList = new Vector();
81 _alignmentList = new Vector();
82 _treeList = new Vector();
83 } //-- org.vamsas.objects.core.DataSet()
97 public void addAlignment(org.vamsas.objects.core.Alignment vAlignment)
98 throws java.lang.IndexOutOfBoundsException
100 _alignmentList.addElement(vAlignment);
101 } //-- void addAlignment(org.vamsas.objects.core.Alignment)
104 * Method addAlignment
111 public void addAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
112 throws java.lang.IndexOutOfBoundsException
114 _alignmentList.insertElementAt(vAlignment, index);
115 } //-- void addAlignment(int, org.vamsas.objects.core.Alignment)
118 * Method addDataSetAnnotations
122 * @param vDataSetAnnotations
124 public void addDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
125 throws java.lang.IndexOutOfBoundsException
127 _dataSetAnnotationsList.addElement(vDataSetAnnotations);
128 } //-- void addDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations)
131 * Method addDataSetAnnotations
136 * @param vDataSetAnnotations
138 public void addDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
139 throws java.lang.IndexOutOfBoundsException
141 _dataSetAnnotationsList.insertElementAt(vDataSetAnnotations, index);
142 } //-- void addDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations)
151 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
152 throws java.lang.IndexOutOfBoundsException
154 _sequenceList.addElement(vSequence);
155 } //-- void addSequence(org.vamsas.objects.core.Sequence)
165 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
166 throws java.lang.IndexOutOfBoundsException
168 _sequenceList.insertElementAt(vSequence, index);
169 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
178 public void addTree(org.vamsas.objects.core.Tree vTree)
179 throws java.lang.IndexOutOfBoundsException
181 _treeList.addElement(vTree);
182 } //-- void addTree(org.vamsas.objects.core.Tree)
192 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
193 throws java.lang.IndexOutOfBoundsException
195 _treeList.insertElementAt(vTree, index);
196 } //-- void addTree(int, org.vamsas.objects.core.Tree)
199 * Method enumerateAlignment
203 * @return Enumeration
205 public java.util.Enumeration enumerateAlignment()
207 return _alignmentList.elements();
208 } //-- java.util.Enumeration enumerateAlignment()
211 * Method enumerateDataSetAnnotations
215 * @return Enumeration
217 public java.util.Enumeration enumerateDataSetAnnotations()
219 return _dataSetAnnotationsList.elements();
220 } //-- java.util.Enumeration enumerateDataSetAnnotations()
223 * Method enumerateSequence
227 * @return Enumeration
229 public java.util.Enumeration enumerateSequence()
231 return _sequenceList.elements();
232 } //-- java.util.Enumeration enumerateSequence()
235 * Method enumerateTree
239 * @return Enumeration
241 public java.util.Enumeration enumerateTree()
243 return _treeList.elements();
244 } //-- java.util.Enumeration enumerateTree()
247 * Note: hashCode() has not been overriden
252 public boolean equals(java.lang.Object obj)
257 if (super.equals(obj)==false)
260 if (obj instanceof DataSet) {
262 DataSet temp = (DataSet)obj;
263 if (this._id != null) {
264 if (temp._id == null) return false;
265 else if (!(this._id.equals(temp._id)))
268 else if (temp._id != null)
270 if (this._sequenceList != null) {
271 if (temp._sequenceList == null) return false;
272 else if (!(this._sequenceList.equals(temp._sequenceList)))
275 else if (temp._sequenceList != null)
277 if (this._dataSetAnnotationsList != null) {
278 if (temp._dataSetAnnotationsList == null) return false;
279 else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)))
282 else if (temp._dataSetAnnotationsList != null)
284 if (this._alignmentList != null) {
285 if (temp._alignmentList == null) return false;
286 else if (!(this._alignmentList.equals(temp._alignmentList)))
289 else if (temp._alignmentList != null)
291 if (this._treeList != null) {
292 if (temp._treeList == null) return false;
293 else if (!(this._treeList.equals(temp._treeList)))
296 else if (temp._treeList != null)
298 if (this._provenance != null) {
299 if (temp._provenance == null) return false;
300 else if (!(this._provenance.equals(temp._provenance)))
303 else if (temp._provenance != null)
308 } //-- boolean equals(java.lang.Object)
311 * Method getAlignment
318 public org.vamsas.objects.core.Alignment getAlignment(int index)
319 throws java.lang.IndexOutOfBoundsException
321 //-- check bounds for index
322 if ((index < 0) || (index > _alignmentList.size())) {
323 throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
326 return (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
327 } //-- org.vamsas.objects.core.Alignment getAlignment(int)
330 * Method getAlignment
336 public org.vamsas.objects.core.Alignment[] getAlignment()
338 int size = _alignmentList.size();
339 org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size];
340 for (int index = 0; index < size; index++) {
341 mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
344 } //-- org.vamsas.objects.core.Alignment[] getAlignment()
347 * Method getAlignmentCount
353 public int getAlignmentCount()
355 return _alignmentList.size();
356 } //-- int getAlignmentCount()
359 * Method getDataSetAnnotations
364 * @return DataSetAnnotations
366 public org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int index)
367 throws java.lang.IndexOutOfBoundsException
369 //-- check bounds for index
370 if ((index < 0) || (index > _dataSetAnnotationsList.size())) {
371 throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]");
374 return (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index);
375 } //-- org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int)
378 * Method getDataSetAnnotations
382 * @return DataSetAnnotations
384 public org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations()
386 int size = _dataSetAnnotationsList.size();
387 org.vamsas.objects.core.DataSetAnnotations[] mArray = new org.vamsas.objects.core.DataSetAnnotations[size];
388 for (int index = 0; index < size; index++) {
389 mArray[index] = (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index);
392 } //-- org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations()
395 * Method getDataSetAnnotationsCount
401 public int getDataSetAnnotationsCount()
403 return _dataSetAnnotationsList.size();
404 } //-- int getDataSetAnnotationsCount()
407 * Returns the value of field 'id'. The field 'id' has the
408 * following description: Primary Key for vamsas object
413 * @return the value of field 'id'.
415 public java.lang.String getId()
418 } //-- java.lang.String getId()
421 * Returns the value of field 'provenance'.
424 * @return the value of field 'provenance'.
426 public org.vamsas.objects.core.Provenance getProvenance()
428 return this._provenance;
429 } //-- org.vamsas.objects.core.Provenance getProvenance()
439 public org.vamsas.objects.core.Sequence getSequence(int index)
440 throws java.lang.IndexOutOfBoundsException
442 //-- check bounds for index
443 if ((index < 0) || (index > _sequenceList.size())) {
444 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
447 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
448 } //-- org.vamsas.objects.core.Sequence getSequence(int)
457 public org.vamsas.objects.core.Sequence[] getSequence()
459 int size = _sequenceList.size();
460 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
461 for (int index = 0; index < size; index++) {
462 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
465 } //-- org.vamsas.objects.core.Sequence[] getSequence()
468 * Method getSequenceCount
474 public int getSequenceCount()
476 return _sequenceList.size();
477 } //-- int getSequenceCount()
487 public org.vamsas.objects.core.Tree getTree(int index)
488 throws java.lang.IndexOutOfBoundsException
490 //-- check bounds for index
491 if ((index < 0) || (index > _treeList.size())) {
492 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
495 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
496 } //-- org.vamsas.objects.core.Tree getTree(int)
505 public org.vamsas.objects.core.Tree[] getTree()
507 int size = _treeList.size();
508 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
509 for (int index = 0; index < size; index++) {
510 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
513 } //-- org.vamsas.objects.core.Tree[] getTree()
516 * Method getTreeCount
522 public int getTreeCount()
524 return _treeList.size();
525 } //-- int getTreeCount()
534 public boolean isValid()
539 catch (org.exolab.castor.xml.ValidationException vex) {
543 } //-- boolean isValid()
552 public void marshal(java.io.Writer out)
553 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
556 Marshaller.marshal(this, out);
557 } //-- void marshal(java.io.Writer)
566 public void marshal(org.xml.sax.ContentHandler handler)
567 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
570 Marshaller.marshal(this, handler);
571 } //-- void marshal(org.xml.sax.ContentHandler)
574 * Method removeAlignment
581 public org.vamsas.objects.core.Alignment removeAlignment(int index)
583 java.lang.Object obj = _alignmentList.elementAt(index);
584 _alignmentList.removeElementAt(index);
585 return (org.vamsas.objects.core.Alignment) obj;
586 } //-- org.vamsas.objects.core.Alignment removeAlignment(int)
589 * Method removeAllAlignment
592 public void removeAllAlignment()
594 _alignmentList.removeAllElements();
595 } //-- void removeAllAlignment()
598 * Method removeAllDataSetAnnotations
601 public void removeAllDataSetAnnotations()
603 _dataSetAnnotationsList.removeAllElements();
604 } //-- void removeAllDataSetAnnotations()
607 * Method removeAllSequence
610 public void removeAllSequence()
612 _sequenceList.removeAllElements();
613 } //-- void removeAllSequence()
616 * Method removeAllTree
619 public void removeAllTree()
621 _treeList.removeAllElements();
622 } //-- void removeAllTree()
625 * Method removeDataSetAnnotations
630 * @return DataSetAnnotations
632 public org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index)
634 java.lang.Object obj = _dataSetAnnotationsList.elementAt(index);
635 _dataSetAnnotationsList.removeElementAt(index);
636 return (org.vamsas.objects.core.DataSetAnnotations) obj;
637 } //-- org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int)
640 * Method removeSequence
647 public org.vamsas.objects.core.Sequence removeSequence(int index)
649 java.lang.Object obj = _sequenceList.elementAt(index);
650 _sequenceList.removeElementAt(index);
651 return (org.vamsas.objects.core.Sequence) obj;
652 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
662 public org.vamsas.objects.core.Tree removeTree(int index)
664 java.lang.Object obj = _treeList.elementAt(index);
665 _treeList.removeElementAt(index);
666 return (org.vamsas.objects.core.Tree) obj;
667 } //-- org.vamsas.objects.core.Tree removeTree(int)
670 * Method setAlignment
677 public void setAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
678 throws java.lang.IndexOutOfBoundsException
680 //-- check bounds for index
681 if ((index < 0) || (index > _alignmentList.size())) {
682 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
684 _alignmentList.setElementAt(vAlignment, index);
685 } //-- void setAlignment(int, org.vamsas.objects.core.Alignment)
688 * Method setAlignment
692 * @param alignmentArray
694 public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray)
697 _alignmentList.removeAllElements();
698 for (int i = 0; i < alignmentArray.length; i++) {
699 _alignmentList.addElement(alignmentArray[i]);
701 } //-- void setAlignment(org.vamsas.objects.core.Alignment)
704 * Method setDataSetAnnotations
709 * @param vDataSetAnnotations
711 public void setDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
712 throws java.lang.IndexOutOfBoundsException
714 //-- check bounds for index
715 if ((index < 0) || (index > _dataSetAnnotationsList.size())) {
716 throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]");
718 _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index);
719 } //-- void setDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations)
722 * Method setDataSetAnnotations
726 * @param dataSetAnnotationsArray
728 public void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray)
731 _dataSetAnnotationsList.removeAllElements();
732 for (int i = 0; i < dataSetAnnotationsArray.length; i++) {
733 _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]);
735 } //-- void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations)
738 * Sets the value of field 'id'. The field 'id' has the
739 * following description: Primary Key for vamsas object
743 * @param id the value of field 'id'.
745 public void setId(java.lang.String id)
748 } //-- void setId(java.lang.String)
751 * Sets the value of field 'provenance'.
753 * @param provenance the value of field 'provenance'.
755 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
757 this._provenance = provenance;
758 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
768 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
769 throws java.lang.IndexOutOfBoundsException
771 //-- check bounds for index
772 if ((index < 0) || (index > _sequenceList.size())) {
773 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
775 _sequenceList.setElementAt(vSequence, index);
776 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
783 * @param sequenceArray
785 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
788 _sequenceList.removeAllElements();
789 for (int i = 0; i < sequenceArray.length; i++) {
790 _sequenceList.addElement(sequenceArray[i]);
792 } //-- void setSequence(org.vamsas.objects.core.Sequence)
802 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
803 throws java.lang.IndexOutOfBoundsException
805 //-- check bounds for index
806 if ((index < 0) || (index > _treeList.size())) {
807 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
809 _treeList.setElementAt(vTree, index);
810 } //-- void setTree(int, org.vamsas.objects.core.Tree)
819 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
822 _treeList.removeAllElements();
823 for (int i = 0; i < treeArray.length; i++) {
824 _treeList.addElement(treeArray[i]);
826 } //-- void setTree(org.vamsas.objects.core.Tree)
836 public static org.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader)
837 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
839 return (org.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSet.class, reader);
840 } //-- org.vamsas.objects.core.DataSet unmarshal(java.io.Reader)
846 public void validate()
847 throws org.exolab.castor.xml.ValidationException
849 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
850 validator.validate(this);
851 } //-- void validate()