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;
68 private org.vamsas.objects.core.Provenance _provenance;
78 _sequenceList = new Vector();
79 _dataSetAnnotationsList = new Vector();
80 _alignmentList = new Vector();
81 _treeList = new Vector();
82 } //-- org.vamsas.objects.core.DataSet()
96 public void addAlignment(org.vamsas.objects.core.Alignment vAlignment)
97 throws java.lang.IndexOutOfBoundsException
99 _alignmentList.addElement(vAlignment);
100 } //-- void addAlignment(org.vamsas.objects.core.Alignment)
103 * Method addAlignment
110 public void addAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
111 throws java.lang.IndexOutOfBoundsException
113 _alignmentList.insertElementAt(vAlignment, index);
114 } //-- void addAlignment(int, org.vamsas.objects.core.Alignment)
117 * Method addDataSetAnnotations
121 * @param vDataSetAnnotations
123 public void addDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
124 throws java.lang.IndexOutOfBoundsException
126 _dataSetAnnotationsList.addElement(vDataSetAnnotations);
127 } //-- void addDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations)
130 * Method addDataSetAnnotations
135 * @param vDataSetAnnotations
137 public void addDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
138 throws java.lang.IndexOutOfBoundsException
140 _dataSetAnnotationsList.insertElementAt(vDataSetAnnotations, index);
141 } //-- void addDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations)
150 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
151 throws java.lang.IndexOutOfBoundsException
153 _sequenceList.addElement(vSequence);
154 } //-- void addSequence(org.vamsas.objects.core.Sequence)
164 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
165 throws java.lang.IndexOutOfBoundsException
167 _sequenceList.insertElementAt(vSequence, index);
168 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
177 public void addTree(org.vamsas.objects.core.Tree vTree)
178 throws java.lang.IndexOutOfBoundsException
180 _treeList.addElement(vTree);
181 } //-- void addTree(org.vamsas.objects.core.Tree)
191 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
192 throws java.lang.IndexOutOfBoundsException
194 _treeList.insertElementAt(vTree, index);
195 } //-- void addTree(int, org.vamsas.objects.core.Tree)
198 * Method enumerateAlignment
202 * @return Enumeration
204 public java.util.Enumeration enumerateAlignment()
206 return _alignmentList.elements();
207 } //-- java.util.Enumeration enumerateAlignment()
210 * Method enumerateDataSetAnnotations
214 * @return Enumeration
216 public java.util.Enumeration enumerateDataSetAnnotations()
218 return _dataSetAnnotationsList.elements();
219 } //-- java.util.Enumeration enumerateDataSetAnnotations()
222 * Method enumerateSequence
226 * @return Enumeration
228 public java.util.Enumeration enumerateSequence()
230 return _sequenceList.elements();
231 } //-- java.util.Enumeration enumerateSequence()
234 * Method enumerateTree
238 * @return Enumeration
240 public java.util.Enumeration enumerateTree()
242 return _treeList.elements();
243 } //-- java.util.Enumeration enumerateTree()
246 * Note: hashCode() has not been overriden
251 public boolean equals(java.lang.Object obj)
256 if (super.equals(obj)==false)
259 if (obj instanceof DataSet) {
261 DataSet temp = (DataSet)obj;
262 if (this._id != null) {
263 if (temp._id == null) return false;
264 else if (!(this._id.equals(temp._id)))
267 else if (temp._id != null)
269 if (this._sequenceList != null) {
270 if (temp._sequenceList == null) return false;
271 else if (!(this._sequenceList.equals(temp._sequenceList)))
274 else if (temp._sequenceList != null)
276 if (this._dataSetAnnotationsList != null) {
277 if (temp._dataSetAnnotationsList == null) return false;
278 else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)))
281 else if (temp._dataSetAnnotationsList != null)
283 if (this._alignmentList != null) {
284 if (temp._alignmentList == null) return false;
285 else if (!(this._alignmentList.equals(temp._alignmentList)))
288 else if (temp._alignmentList != null)
290 if (this._treeList != null) {
291 if (temp._treeList == null) return false;
292 else if (!(this._treeList.equals(temp._treeList)))
295 else if (temp._treeList != null)
297 if (this._provenance != null) {
298 if (temp._provenance == null) return false;
299 else if (!(this._provenance.equals(temp._provenance)))
302 else if (temp._provenance != null)
307 } //-- boolean equals(java.lang.Object)
310 * Method getAlignment
317 public org.vamsas.objects.core.Alignment getAlignment(int index)
318 throws java.lang.IndexOutOfBoundsException
320 //-- check bounds for index
321 if ((index < 0) || (index > _alignmentList.size())) {
322 throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
325 return (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
326 } //-- org.vamsas.objects.core.Alignment getAlignment(int)
329 * Method getAlignment
335 public org.vamsas.objects.core.Alignment[] getAlignment()
337 int size = _alignmentList.size();
338 org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size];
339 for (int index = 0; index < size; index++) {
340 mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
343 } //-- org.vamsas.objects.core.Alignment[] getAlignment()
346 * Method getAlignmentCount
352 public int getAlignmentCount()
354 return _alignmentList.size();
355 } //-- int getAlignmentCount()
358 * Method getDataSetAnnotations
363 * @return DataSetAnnotations
365 public org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int index)
366 throws java.lang.IndexOutOfBoundsException
368 //-- check bounds for index
369 if ((index < 0) || (index > _dataSetAnnotationsList.size())) {
370 throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]");
373 return (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index);
374 } //-- org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int)
377 * Method getDataSetAnnotations
381 * @return DataSetAnnotations
383 public org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations()
385 int size = _dataSetAnnotationsList.size();
386 org.vamsas.objects.core.DataSetAnnotations[] mArray = new org.vamsas.objects.core.DataSetAnnotations[size];
387 for (int index = 0; index < size; index++) {
388 mArray[index] = (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index);
391 } //-- org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations()
394 * Method getDataSetAnnotationsCount
400 public int getDataSetAnnotationsCount()
402 return _dataSetAnnotationsList.size();
403 } //-- int getDataSetAnnotationsCount()
406 * Returns the value of field 'id'.
409 * @return the value of field 'id'.
411 public java.lang.String getId()
414 } //-- java.lang.String getId()
417 * Returns the value of field 'provenance'.
420 * @return the value of field 'provenance'.
422 public org.vamsas.objects.core.Provenance getProvenance()
424 return this._provenance;
425 } //-- org.vamsas.objects.core.Provenance getProvenance()
435 public org.vamsas.objects.core.Sequence getSequence(int index)
436 throws java.lang.IndexOutOfBoundsException
438 //-- check bounds for index
439 if ((index < 0) || (index > _sequenceList.size())) {
440 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
443 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
444 } //-- org.vamsas.objects.core.Sequence getSequence(int)
453 public org.vamsas.objects.core.Sequence[] getSequence()
455 int size = _sequenceList.size();
456 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
457 for (int index = 0; index < size; index++) {
458 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
461 } //-- org.vamsas.objects.core.Sequence[] getSequence()
464 * Method getSequenceCount
470 public int getSequenceCount()
472 return _sequenceList.size();
473 } //-- int getSequenceCount()
483 public org.vamsas.objects.core.Tree getTree(int index)
484 throws java.lang.IndexOutOfBoundsException
486 //-- check bounds for index
487 if ((index < 0) || (index > _treeList.size())) {
488 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
491 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
492 } //-- org.vamsas.objects.core.Tree getTree(int)
501 public org.vamsas.objects.core.Tree[] getTree()
503 int size = _treeList.size();
504 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
505 for (int index = 0; index < size; index++) {
506 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
509 } //-- org.vamsas.objects.core.Tree[] getTree()
512 * Method getTreeCount
518 public int getTreeCount()
520 return _treeList.size();
521 } //-- int getTreeCount()
530 public boolean isValid()
535 catch (org.exolab.castor.xml.ValidationException vex) {
539 } //-- boolean isValid()
548 public void marshal(java.io.Writer out)
549 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
552 Marshaller.marshal(this, out);
553 } //-- void marshal(java.io.Writer)
562 public void marshal(org.xml.sax.ContentHandler handler)
563 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
566 Marshaller.marshal(this, handler);
567 } //-- void marshal(org.xml.sax.ContentHandler)
570 * Method removeAlignment
577 public org.vamsas.objects.core.Alignment removeAlignment(int index)
579 java.lang.Object obj = _alignmentList.elementAt(index);
580 _alignmentList.removeElementAt(index);
581 return (org.vamsas.objects.core.Alignment) obj;
582 } //-- org.vamsas.objects.core.Alignment removeAlignment(int)
585 * Method removeAllAlignment
588 public void removeAllAlignment()
590 _alignmentList.removeAllElements();
591 } //-- void removeAllAlignment()
594 * Method removeAllDataSetAnnotations
597 public void removeAllDataSetAnnotations()
599 _dataSetAnnotationsList.removeAllElements();
600 } //-- void removeAllDataSetAnnotations()
603 * Method removeAllSequence
606 public void removeAllSequence()
608 _sequenceList.removeAllElements();
609 } //-- void removeAllSequence()
612 * Method removeAllTree
615 public void removeAllTree()
617 _treeList.removeAllElements();
618 } //-- void removeAllTree()
621 * Method removeDataSetAnnotations
626 * @return DataSetAnnotations
628 public org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index)
630 java.lang.Object obj = _dataSetAnnotationsList.elementAt(index);
631 _dataSetAnnotationsList.removeElementAt(index);
632 return (org.vamsas.objects.core.DataSetAnnotations) obj;
633 } //-- org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int)
636 * Method removeSequence
643 public org.vamsas.objects.core.Sequence removeSequence(int index)
645 java.lang.Object obj = _sequenceList.elementAt(index);
646 _sequenceList.removeElementAt(index);
647 return (org.vamsas.objects.core.Sequence) obj;
648 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
658 public org.vamsas.objects.core.Tree removeTree(int index)
660 java.lang.Object obj = _treeList.elementAt(index);
661 _treeList.removeElementAt(index);
662 return (org.vamsas.objects.core.Tree) obj;
663 } //-- org.vamsas.objects.core.Tree removeTree(int)
666 * Method setAlignment
673 public void setAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
674 throws java.lang.IndexOutOfBoundsException
676 //-- check bounds for index
677 if ((index < 0) || (index > _alignmentList.size())) {
678 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
680 _alignmentList.setElementAt(vAlignment, index);
681 } //-- void setAlignment(int, org.vamsas.objects.core.Alignment)
684 * Method setAlignment
688 * @param alignmentArray
690 public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray)
693 _alignmentList.removeAllElements();
694 for (int i = 0; i < alignmentArray.length; i++) {
695 _alignmentList.addElement(alignmentArray[i]);
697 } //-- void setAlignment(org.vamsas.objects.core.Alignment)
700 * Method setDataSetAnnotations
705 * @param vDataSetAnnotations
707 public void setDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
708 throws java.lang.IndexOutOfBoundsException
710 //-- check bounds for index
711 if ((index < 0) || (index > _dataSetAnnotationsList.size())) {
712 throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]");
714 _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index);
715 } //-- void setDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations)
718 * Method setDataSetAnnotations
722 * @param dataSetAnnotationsArray
724 public void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray)
727 _dataSetAnnotationsList.removeAllElements();
728 for (int i = 0; i < dataSetAnnotationsArray.length; i++) {
729 _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]);
731 } //-- void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations)
734 * Sets the value of field 'id'.
736 * @param id the value of field 'id'.
738 public void setId(java.lang.String id)
741 } //-- void setId(java.lang.String)
744 * Sets the value of field 'provenance'.
746 * @param provenance the value of field 'provenance'.
748 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
750 this._provenance = provenance;
751 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
761 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
762 throws java.lang.IndexOutOfBoundsException
764 //-- check bounds for index
765 if ((index < 0) || (index > _sequenceList.size())) {
766 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
768 _sequenceList.setElementAt(vSequence, index);
769 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
776 * @param sequenceArray
778 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
781 _sequenceList.removeAllElements();
782 for (int i = 0; i < sequenceArray.length; i++) {
783 _sequenceList.addElement(sequenceArray[i]);
785 } //-- void setSequence(org.vamsas.objects.core.Sequence)
795 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
796 throws java.lang.IndexOutOfBoundsException
798 //-- check bounds for index
799 if ((index < 0) || (index > _treeList.size())) {
800 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
802 _treeList.setElementAt(vTree, index);
803 } //-- void setTree(int, org.vamsas.objects.core.Tree)
812 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
815 _treeList.removeAllElements();
816 for (int i = 0; i < treeArray.length; i++) {
817 _treeList.addElement(treeArray[i]);
819 } //-- void setTree(org.vamsas.objects.core.Tree)
829 public static org.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader)
830 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
832 return (org.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSet.class, reader);
833 } //-- org.vamsas.objects.core.DataSet unmarshal(java.io.Reader)
839 public void validate()
840 throws org.exolab.castor.xml.ValidationException
842 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
843 validator.validate(this);
844 } //-- void validate()