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 SequenceSet 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 _sequenceSetAnnotationsList
53 private java.util.Vector _sequenceSetAnnotationsList;
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 _sequenceSetAnnotationsList = new Vector();
80 _alignmentList = new Vector();
81 _treeList = new Vector();
82 } //-- org.vamsas.objects.core.SequenceSet()
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)
123 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
124 throws java.lang.IndexOutOfBoundsException
126 _sequenceList.addElement(vSequence);
127 } //-- void addSequence(org.vamsas.objects.core.Sequence)
137 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
138 throws java.lang.IndexOutOfBoundsException
140 _sequenceList.insertElementAt(vSequence, index);
141 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
144 * Method addSequenceSetAnnotations
148 * @param vSequenceSetAnnotations
150 public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
151 throws java.lang.IndexOutOfBoundsException
153 _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations);
154 } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
157 * Method addSequenceSetAnnotations
162 * @param vSequenceSetAnnotations
164 public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
165 throws java.lang.IndexOutOfBoundsException
167 _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index);
168 } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
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 enumerateSequence
214 * @return Enumeration
216 public java.util.Enumeration enumerateSequence()
218 return _sequenceList.elements();
219 } //-- java.util.Enumeration enumerateSequence()
222 * Method enumerateSequenceSetAnnotations
226 * @return Enumeration
228 public java.util.Enumeration enumerateSequenceSetAnnotations()
230 return _sequenceSetAnnotationsList.elements();
231 } //-- java.util.Enumeration enumerateSequenceSetAnnotations()
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 SequenceSet) {
261 SequenceSet temp = (SequenceSet)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._sequenceSetAnnotationsList != null) {
277 if (temp._sequenceSetAnnotationsList == null) return false;
278 else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList)))
281 else if (temp._sequenceSetAnnotationsList != 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 * Returns the value of field 'id'.
361 * @return the value of field 'id'.
363 public java.lang.String getId()
366 } //-- java.lang.String getId()
369 * Returns the value of field 'provenance'.
372 * @return the value of field 'provenance'.
374 public org.vamsas.objects.core.Provenance getProvenance()
376 return this._provenance;
377 } //-- org.vamsas.objects.core.Provenance getProvenance()
387 public org.vamsas.objects.core.Sequence getSequence(int index)
388 throws java.lang.IndexOutOfBoundsException
390 //-- check bounds for index
391 if ((index < 0) || (index > _sequenceList.size())) {
392 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
395 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
396 } //-- org.vamsas.objects.core.Sequence getSequence(int)
405 public org.vamsas.objects.core.Sequence[] getSequence()
407 int size = _sequenceList.size();
408 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
409 for (int index = 0; index < size; index++) {
410 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
413 } //-- org.vamsas.objects.core.Sequence[] getSequence()
416 * Method getSequenceCount
422 public int getSequenceCount()
424 return _sequenceList.size();
425 } //-- int getSequenceCount()
428 * Method getSequenceSetAnnotations
433 * @return SequenceSetAnnotations
435 public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index)
436 throws java.lang.IndexOutOfBoundsException
438 //-- check bounds for index
439 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
440 throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
443 return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
444 } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int)
447 * Method getSequenceSetAnnotations
451 * @return SequenceSetAnnotations
453 public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
455 int size = _sequenceSetAnnotationsList.size();
456 org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size];
457 for (int index = 0; index < size; index++) {
458 mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
461 } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
464 * Method getSequenceSetAnnotationsCount
470 public int getSequenceSetAnnotationsCount()
472 return _sequenceSetAnnotationsList.size();
473 } //-- int getSequenceSetAnnotationsCount()
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 removeAllSequence
597 public void removeAllSequence()
599 _sequenceList.removeAllElements();
600 } //-- void removeAllSequence()
603 * Method removeAllSequenceSetAnnotations
606 public void removeAllSequenceSetAnnotations()
608 _sequenceSetAnnotationsList.removeAllElements();
609 } //-- void removeAllSequenceSetAnnotations()
612 * Method removeAllTree
615 public void removeAllTree()
617 _treeList.removeAllElements();
618 } //-- void removeAllTree()
621 * Method removeSequence
628 public org.vamsas.objects.core.Sequence removeSequence(int index)
630 java.lang.Object obj = _sequenceList.elementAt(index);
631 _sequenceList.removeElementAt(index);
632 return (org.vamsas.objects.core.Sequence) obj;
633 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
636 * Method removeSequenceSetAnnotations
641 * @return SequenceSetAnnotations
643 public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index)
645 java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index);
646 _sequenceSetAnnotationsList.removeElementAt(index);
647 return (org.vamsas.objects.core.SequenceSetAnnotations) obj;
648 } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(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 * Sets the value of field 'id'.
702 * @param id the value of field 'id'.
704 public void setId(java.lang.String id)
707 } //-- void setId(java.lang.String)
710 * Sets the value of field 'provenance'.
712 * @param provenance the value of field 'provenance'.
714 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
716 this._provenance = provenance;
717 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
727 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
728 throws java.lang.IndexOutOfBoundsException
730 //-- check bounds for index
731 if ((index < 0) || (index > _sequenceList.size())) {
732 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
734 _sequenceList.setElementAt(vSequence, index);
735 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
742 * @param sequenceArray
744 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
747 _sequenceList.removeAllElements();
748 for (int i = 0; i < sequenceArray.length; i++) {
749 _sequenceList.addElement(sequenceArray[i]);
751 } //-- void setSequence(org.vamsas.objects.core.Sequence)
754 * Method setSequenceSetAnnotations
759 * @param vSequenceSetAnnotations
761 public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
762 throws java.lang.IndexOutOfBoundsException
764 //-- check bounds for index
765 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
766 throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
768 _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index);
769 } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
772 * Method setSequenceSetAnnotations
776 * @param sequenceSetAnnotationsArray
778 public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray)
781 _sequenceSetAnnotationsList.removeAllElements();
782 for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) {
783 _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]);
785 } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
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)
827 * @return SequenceSet
829 public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader)
830 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
832 return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader);
833 } //-- org.vamsas.objects.core.SequenceSet 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()