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.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private java.lang.String _id;
48 private java.util.Vector _sequenceList;
51 * Field _dataSetAnnotationsList
53 private java.util.Vector _dataSetAnnotationsList;
56 * Field _alignmentList
58 private java.util.Vector _alignmentList;
63 private java.util.Vector _treeList;
66 * Field _provenanceList
68 private java.util.Vector _provenanceList;
78 _sequenceList = new Vector();
79 _dataSetAnnotationsList = new Vector();
80 _alignmentList = new Vector();
81 _treeList = new Vector();
82 _provenanceList = 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)
145 * Method addProvenance
151 public void addProvenance(org.vamsas.objects.core.Provenance vProvenance)
152 throws java.lang.IndexOutOfBoundsException
154 _provenanceList.addElement(vProvenance);
155 } //-- void addProvenance(org.vamsas.objects.core.Provenance)
158 * Method addProvenance
165 public void addProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
166 throws java.lang.IndexOutOfBoundsException
168 _provenanceList.insertElementAt(vProvenance, index);
169 } //-- void addProvenance(int, org.vamsas.objects.core.Provenance)
178 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
179 throws java.lang.IndexOutOfBoundsException
181 _sequenceList.addElement(vSequence);
182 } //-- void addSequence(org.vamsas.objects.core.Sequence)
192 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
193 throws java.lang.IndexOutOfBoundsException
195 _sequenceList.insertElementAt(vSequence, index);
196 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
205 public void addTree(org.vamsas.objects.core.Tree vTree)
206 throws java.lang.IndexOutOfBoundsException
208 _treeList.addElement(vTree);
209 } //-- void addTree(org.vamsas.objects.core.Tree)
219 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
220 throws java.lang.IndexOutOfBoundsException
222 _treeList.insertElementAt(vTree, index);
223 } //-- void addTree(int, org.vamsas.objects.core.Tree)
226 * Method enumerateAlignment
230 * @return Enumeration
232 public java.util.Enumeration enumerateAlignment()
234 return _alignmentList.elements();
235 } //-- java.util.Enumeration enumerateAlignment()
238 * Method enumerateDataSetAnnotations
242 * @return Enumeration
244 public java.util.Enumeration enumerateDataSetAnnotations()
246 return _dataSetAnnotationsList.elements();
247 } //-- java.util.Enumeration enumerateDataSetAnnotations()
250 * Method enumerateProvenance
254 * @return Enumeration
256 public java.util.Enumeration enumerateProvenance()
258 return _provenanceList.elements();
259 } //-- java.util.Enumeration enumerateProvenance()
262 * Method enumerateSequence
266 * @return Enumeration
268 public java.util.Enumeration enumerateSequence()
270 return _sequenceList.elements();
271 } //-- java.util.Enumeration enumerateSequence()
274 * Method enumerateTree
278 * @return Enumeration
280 public java.util.Enumeration enumerateTree()
282 return _treeList.elements();
283 } //-- java.util.Enumeration enumerateTree()
286 * Note: hashCode() has not been overriden
291 public boolean equals(java.lang.Object obj)
296 if (super.equals(obj)==false)
299 if (obj instanceof DataSet) {
301 DataSet temp = (DataSet)obj;
302 if (this._id != null) {
303 if (temp._id == null) return false;
304 else if (!(this._id.equals(temp._id)))
307 else if (temp._id != null)
309 if (this._sequenceList != null) {
310 if (temp._sequenceList == null) return false;
311 else if (!(this._sequenceList.equals(temp._sequenceList)))
314 else if (temp._sequenceList != null)
316 if (this._dataSetAnnotationsList != null) {
317 if (temp._dataSetAnnotationsList == null) return false;
318 else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)))
321 else if (temp._dataSetAnnotationsList != null)
323 if (this._alignmentList != null) {
324 if (temp._alignmentList == null) return false;
325 else if (!(this._alignmentList.equals(temp._alignmentList)))
328 else if (temp._alignmentList != null)
330 if (this._treeList != null) {
331 if (temp._treeList == null) return false;
332 else if (!(this._treeList.equals(temp._treeList)))
335 else if (temp._treeList != null)
337 if (this._provenanceList != null) {
338 if (temp._provenanceList == null) return false;
339 else if (!(this._provenanceList.equals(temp._provenanceList)))
342 else if (temp._provenanceList != null)
347 } //-- boolean equals(java.lang.Object)
350 * Method getAlignment
357 public org.vamsas.objects.core.Alignment getAlignment(int index)
358 throws java.lang.IndexOutOfBoundsException
360 //-- check bounds for index
361 if ((index < 0) || (index > _alignmentList.size())) {
362 throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
365 return (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
366 } //-- org.vamsas.objects.core.Alignment getAlignment(int)
369 * Method getAlignment
375 public org.vamsas.objects.core.Alignment[] getAlignment()
377 int size = _alignmentList.size();
378 org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size];
379 for (int index = 0; index < size; index++) {
380 mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
383 } //-- org.vamsas.objects.core.Alignment[] getAlignment()
386 * Method getAlignmentCount
392 public int getAlignmentCount()
394 return _alignmentList.size();
395 } //-- int getAlignmentCount()
398 * Method getDataSetAnnotations
403 * @return DataSetAnnotations
405 public org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int index)
406 throws java.lang.IndexOutOfBoundsException
408 //-- check bounds for index
409 if ((index < 0) || (index > _dataSetAnnotationsList.size())) {
410 throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]");
413 return (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index);
414 } //-- org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int)
417 * Method getDataSetAnnotations
421 * @return DataSetAnnotations
423 public org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations()
425 int size = _dataSetAnnotationsList.size();
426 org.vamsas.objects.core.DataSetAnnotations[] mArray = new org.vamsas.objects.core.DataSetAnnotations[size];
427 for (int index = 0; index < size; index++) {
428 mArray[index] = (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index);
431 } //-- org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations()
434 * Method getDataSetAnnotationsCount
440 public int getDataSetAnnotationsCount()
442 return _dataSetAnnotationsList.size();
443 } //-- int getDataSetAnnotationsCount()
446 * Returns the value of field 'id'.
449 * @return the value of field 'id'.
451 public java.lang.String getId()
454 } //-- java.lang.String getId()
457 * Method getProvenance
464 public org.vamsas.objects.core.Provenance getProvenance(int index)
465 throws java.lang.IndexOutOfBoundsException
467 //-- check bounds for index
468 if ((index < 0) || (index > _provenanceList.size())) {
469 throw new IndexOutOfBoundsException("getProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
472 return (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
473 } //-- org.vamsas.objects.core.Provenance getProvenance(int)
476 * Method getProvenance
482 public org.vamsas.objects.core.Provenance[] getProvenance()
484 int size = _provenanceList.size();
485 org.vamsas.objects.core.Provenance[] mArray = new org.vamsas.objects.core.Provenance[size];
486 for (int index = 0; index < size; index++) {
487 mArray[index] = (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
490 } //-- org.vamsas.objects.core.Provenance[] getProvenance()
493 * Method getProvenanceCount
499 public int getProvenanceCount()
501 return _provenanceList.size();
502 } //-- int getProvenanceCount()
512 public org.vamsas.objects.core.Sequence getSequence(int index)
513 throws java.lang.IndexOutOfBoundsException
515 //-- check bounds for index
516 if ((index < 0) || (index > _sequenceList.size())) {
517 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
520 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
521 } //-- org.vamsas.objects.core.Sequence getSequence(int)
530 public org.vamsas.objects.core.Sequence[] getSequence()
532 int size = _sequenceList.size();
533 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
534 for (int index = 0; index < size; index++) {
535 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
538 } //-- org.vamsas.objects.core.Sequence[] getSequence()
541 * Method getSequenceCount
547 public int getSequenceCount()
549 return _sequenceList.size();
550 } //-- int getSequenceCount()
560 public org.vamsas.objects.core.Tree getTree(int index)
561 throws java.lang.IndexOutOfBoundsException
563 //-- check bounds for index
564 if ((index < 0) || (index > _treeList.size())) {
565 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
568 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
569 } //-- org.vamsas.objects.core.Tree getTree(int)
578 public org.vamsas.objects.core.Tree[] getTree()
580 int size = _treeList.size();
581 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
582 for (int index = 0; index < size; index++) {
583 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
586 } //-- org.vamsas.objects.core.Tree[] getTree()
589 * Method getTreeCount
595 public int getTreeCount()
597 return _treeList.size();
598 } //-- int getTreeCount()
607 public boolean isValid()
612 catch (org.exolab.castor.xml.ValidationException vex) {
616 } //-- boolean isValid()
625 public void marshal(java.io.Writer out)
626 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
629 Marshaller.marshal(this, out);
630 } //-- void marshal(java.io.Writer)
639 public void marshal(org.xml.sax.ContentHandler handler)
640 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
643 Marshaller.marshal(this, handler);
644 } //-- void marshal(org.xml.sax.ContentHandler)
647 * Method removeAlignment
654 public org.vamsas.objects.core.Alignment removeAlignment(int index)
656 java.lang.Object obj = _alignmentList.elementAt(index);
657 _alignmentList.removeElementAt(index);
658 return (org.vamsas.objects.core.Alignment) obj;
659 } //-- org.vamsas.objects.core.Alignment removeAlignment(int)
662 * Method removeAllAlignment
665 public void removeAllAlignment()
667 _alignmentList.removeAllElements();
668 } //-- void removeAllAlignment()
671 * Method removeAllDataSetAnnotations
674 public void removeAllDataSetAnnotations()
676 _dataSetAnnotationsList.removeAllElements();
677 } //-- void removeAllDataSetAnnotations()
680 * Method removeAllProvenance
683 public void removeAllProvenance()
685 _provenanceList.removeAllElements();
686 } //-- void removeAllProvenance()
689 * Method removeAllSequence
692 public void removeAllSequence()
694 _sequenceList.removeAllElements();
695 } //-- void removeAllSequence()
698 * Method removeAllTree
701 public void removeAllTree()
703 _treeList.removeAllElements();
704 } //-- void removeAllTree()
707 * Method removeDataSetAnnotations
712 * @return DataSetAnnotations
714 public org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index)
716 java.lang.Object obj = _dataSetAnnotationsList.elementAt(index);
717 _dataSetAnnotationsList.removeElementAt(index);
718 return (org.vamsas.objects.core.DataSetAnnotations) obj;
719 } //-- org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int)
722 * Method removeProvenance
729 public org.vamsas.objects.core.Provenance removeProvenance(int index)
731 java.lang.Object obj = _provenanceList.elementAt(index);
732 _provenanceList.removeElementAt(index);
733 return (org.vamsas.objects.core.Provenance) obj;
734 } //-- org.vamsas.objects.core.Provenance removeProvenance(int)
737 * Method removeSequence
744 public org.vamsas.objects.core.Sequence removeSequence(int index)
746 java.lang.Object obj = _sequenceList.elementAt(index);
747 _sequenceList.removeElementAt(index);
748 return (org.vamsas.objects.core.Sequence) obj;
749 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
759 public org.vamsas.objects.core.Tree removeTree(int index)
761 java.lang.Object obj = _treeList.elementAt(index);
762 _treeList.removeElementAt(index);
763 return (org.vamsas.objects.core.Tree) obj;
764 } //-- org.vamsas.objects.core.Tree removeTree(int)
767 * Method setAlignment
774 public void setAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
775 throws java.lang.IndexOutOfBoundsException
777 //-- check bounds for index
778 if ((index < 0) || (index > _alignmentList.size())) {
779 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
781 _alignmentList.setElementAt(vAlignment, index);
782 } //-- void setAlignment(int, org.vamsas.objects.core.Alignment)
785 * Method setAlignment
789 * @param alignmentArray
791 public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray)
794 _alignmentList.removeAllElements();
795 for (int i = 0; i < alignmentArray.length; i++) {
796 _alignmentList.addElement(alignmentArray[i]);
798 } //-- void setAlignment(org.vamsas.objects.core.Alignment)
801 * Method setDataSetAnnotations
806 * @param vDataSetAnnotations
808 public void setDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
809 throws java.lang.IndexOutOfBoundsException
811 //-- check bounds for index
812 if ((index < 0) || (index > _dataSetAnnotationsList.size())) {
813 throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]");
815 _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index);
816 } //-- void setDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations)
819 * Method setDataSetAnnotations
823 * @param dataSetAnnotationsArray
825 public void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray)
828 _dataSetAnnotationsList.removeAllElements();
829 for (int i = 0; i < dataSetAnnotationsArray.length; i++) {
830 _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]);
832 } //-- void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations)
835 * Sets the value of field 'id'.
837 * @param id the value of field 'id'.
839 public void setId(java.lang.String id)
842 } //-- void setId(java.lang.String)
845 * Method setProvenance
852 public void setProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
853 throws java.lang.IndexOutOfBoundsException
855 //-- check bounds for index
856 if ((index < 0) || (index > _provenanceList.size())) {
857 throw new IndexOutOfBoundsException("setProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
859 _provenanceList.setElementAt(vProvenance, index);
860 } //-- void setProvenance(int, org.vamsas.objects.core.Provenance)
863 * Method setProvenance
867 * @param provenanceArray
869 public void setProvenance(org.vamsas.objects.core.Provenance[] provenanceArray)
872 _provenanceList.removeAllElements();
873 for (int i = 0; i < provenanceArray.length; i++) {
874 _provenanceList.addElement(provenanceArray[i]);
876 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
886 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
887 throws java.lang.IndexOutOfBoundsException
889 //-- check bounds for index
890 if ((index < 0) || (index > _sequenceList.size())) {
891 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
893 _sequenceList.setElementAt(vSequence, index);
894 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
901 * @param sequenceArray
903 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
906 _sequenceList.removeAllElements();
907 for (int i = 0; i < sequenceArray.length; i++) {
908 _sequenceList.addElement(sequenceArray[i]);
910 } //-- void setSequence(org.vamsas.objects.core.Sequence)
920 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
921 throws java.lang.IndexOutOfBoundsException
923 //-- check bounds for index
924 if ((index < 0) || (index > _treeList.size())) {
925 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
927 _treeList.setElementAt(vTree, index);
928 } //-- void setTree(int, org.vamsas.objects.core.Tree)
937 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
940 _treeList.removeAllElements();
941 for (int i = 0; i < treeArray.length; i++) {
942 _treeList.addElement(treeArray[i]);
944 } //-- void setTree(org.vamsas.objects.core.Tree)
954 public static org.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader)
955 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
957 return (org.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSet.class, reader);
958 } //-- org.vamsas.objects.core.DataSet unmarshal(java.io.Reader)
964 public void validate()
965 throws org.exolab.castor.xml.ValidationException
967 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
968 validator.validate(this);
969 } //-- void validate()