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;
66 * Field _provenanceList
68 private java.util.Vector _provenanceList;
78 _sequenceList = new Vector();
79 _sequenceSetAnnotationsList = new Vector();
80 _alignmentList = new Vector();
81 _treeList = new Vector();
82 _provenanceList = new Vector();
83 } //-- org.vamsas.objects.core.SequenceSet()
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 addProvenance
124 public void addProvenance(org.vamsas.objects.core.Provenance vProvenance)
125 throws java.lang.IndexOutOfBoundsException
127 _provenanceList.addElement(vProvenance);
128 } //-- void addProvenance(org.vamsas.objects.core.Provenance)
131 * Method addProvenance
138 public void addProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
139 throws java.lang.IndexOutOfBoundsException
141 _provenanceList.insertElementAt(vProvenance, index);
142 } //-- void addProvenance(int, org.vamsas.objects.core.Provenance)
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)
172 * Method addSequenceSetAnnotations
176 * @param vSequenceSetAnnotations
178 public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
179 throws java.lang.IndexOutOfBoundsException
181 _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations);
182 } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
185 * Method addSequenceSetAnnotations
190 * @param vSequenceSetAnnotations
192 public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
193 throws java.lang.IndexOutOfBoundsException
195 _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index);
196 } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
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 enumerateProvenance
242 * @return Enumeration
244 public java.util.Enumeration enumerateProvenance()
246 return _provenanceList.elements();
247 } //-- java.util.Enumeration enumerateProvenance()
250 * Method enumerateSequence
254 * @return Enumeration
256 public java.util.Enumeration enumerateSequence()
258 return _sequenceList.elements();
259 } //-- java.util.Enumeration enumerateSequence()
262 * Method enumerateSequenceSetAnnotations
266 * @return Enumeration
268 public java.util.Enumeration enumerateSequenceSetAnnotations()
270 return _sequenceSetAnnotationsList.elements();
271 } //-- java.util.Enumeration enumerateSequenceSetAnnotations()
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 SequenceSet) {
301 SequenceSet temp = (SequenceSet)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._sequenceSetAnnotationsList != null) {
317 if (temp._sequenceSetAnnotationsList == null) return false;
318 else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList)))
321 else if (temp._sequenceSetAnnotationsList != 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 * Returns the value of field 'id'.
401 * @return the value of field 'id'.
403 public java.lang.String getId()
406 } //-- java.lang.String getId()
409 * Method getProvenance
416 public org.vamsas.objects.core.Provenance getProvenance(int index)
417 throws java.lang.IndexOutOfBoundsException
419 //-- check bounds for index
420 if ((index < 0) || (index > _provenanceList.size())) {
421 throw new IndexOutOfBoundsException("getProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
424 return (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
425 } //-- org.vamsas.objects.core.Provenance getProvenance(int)
428 * Method getProvenance
434 public org.vamsas.objects.core.Provenance[] getProvenance()
436 int size = _provenanceList.size();
437 org.vamsas.objects.core.Provenance[] mArray = new org.vamsas.objects.core.Provenance[size];
438 for (int index = 0; index < size; index++) {
439 mArray[index] = (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
442 } //-- org.vamsas.objects.core.Provenance[] getProvenance()
445 * Method getProvenanceCount
451 public int getProvenanceCount()
453 return _provenanceList.size();
454 } //-- int getProvenanceCount()
464 public org.vamsas.objects.core.Sequence getSequence(int index)
465 throws java.lang.IndexOutOfBoundsException
467 //-- check bounds for index
468 if ((index < 0) || (index > _sequenceList.size())) {
469 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
472 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
473 } //-- org.vamsas.objects.core.Sequence getSequence(int)
482 public org.vamsas.objects.core.Sequence[] getSequence()
484 int size = _sequenceList.size();
485 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
486 for (int index = 0; index < size; index++) {
487 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
490 } //-- org.vamsas.objects.core.Sequence[] getSequence()
493 * Method getSequenceCount
499 public int getSequenceCount()
501 return _sequenceList.size();
502 } //-- int getSequenceCount()
505 * Method getSequenceSetAnnotations
510 * @return SequenceSetAnnotations
512 public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index)
513 throws java.lang.IndexOutOfBoundsException
515 //-- check bounds for index
516 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
517 throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
520 return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
521 } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int)
524 * Method getSequenceSetAnnotations
528 * @return SequenceSetAnnotations
530 public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
532 int size = _sequenceSetAnnotationsList.size();
533 org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size];
534 for (int index = 0; index < size; index++) {
535 mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
538 } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
541 * Method getSequenceSetAnnotationsCount
547 public int getSequenceSetAnnotationsCount()
549 return _sequenceSetAnnotationsList.size();
550 } //-- int getSequenceSetAnnotationsCount()
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 removeAllProvenance
674 public void removeAllProvenance()
676 _provenanceList.removeAllElements();
677 } //-- void removeAllProvenance()
680 * Method removeAllSequence
683 public void removeAllSequence()
685 _sequenceList.removeAllElements();
686 } //-- void removeAllSequence()
689 * Method removeAllSequenceSetAnnotations
692 public void removeAllSequenceSetAnnotations()
694 _sequenceSetAnnotationsList.removeAllElements();
695 } //-- void removeAllSequenceSetAnnotations()
698 * Method removeAllTree
701 public void removeAllTree()
703 _treeList.removeAllElements();
704 } //-- void removeAllTree()
707 * Method removeProvenance
714 public org.vamsas.objects.core.Provenance removeProvenance(int index)
716 java.lang.Object obj = _provenanceList.elementAt(index);
717 _provenanceList.removeElementAt(index);
718 return (org.vamsas.objects.core.Provenance) obj;
719 } //-- org.vamsas.objects.core.Provenance removeProvenance(int)
722 * Method removeSequence
729 public org.vamsas.objects.core.Sequence removeSequence(int index)
731 java.lang.Object obj = _sequenceList.elementAt(index);
732 _sequenceList.removeElementAt(index);
733 return (org.vamsas.objects.core.Sequence) obj;
734 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
737 * Method removeSequenceSetAnnotations
742 * @return SequenceSetAnnotations
744 public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index)
746 java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index);
747 _sequenceSetAnnotationsList.removeElementAt(index);
748 return (org.vamsas.objects.core.SequenceSetAnnotations) obj;
749 } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(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 * Sets the value of field 'id'.
803 * @param id the value of field 'id'.
805 public void setId(java.lang.String id)
808 } //-- void setId(java.lang.String)
811 * Method setProvenance
818 public void setProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
819 throws java.lang.IndexOutOfBoundsException
821 //-- check bounds for index
822 if ((index < 0) || (index > _provenanceList.size())) {
823 throw new IndexOutOfBoundsException("setProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
825 _provenanceList.setElementAt(vProvenance, index);
826 } //-- void setProvenance(int, org.vamsas.objects.core.Provenance)
829 * Method setProvenance
833 * @param provenanceArray
835 public void setProvenance(org.vamsas.objects.core.Provenance[] provenanceArray)
838 _provenanceList.removeAllElements();
839 for (int i = 0; i < provenanceArray.length; i++) {
840 _provenanceList.addElement(provenanceArray[i]);
842 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
852 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
853 throws java.lang.IndexOutOfBoundsException
855 //-- check bounds for index
856 if ((index < 0) || (index > _sequenceList.size())) {
857 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
859 _sequenceList.setElementAt(vSequence, index);
860 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
867 * @param sequenceArray
869 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
872 _sequenceList.removeAllElements();
873 for (int i = 0; i < sequenceArray.length; i++) {
874 _sequenceList.addElement(sequenceArray[i]);
876 } //-- void setSequence(org.vamsas.objects.core.Sequence)
879 * Method setSequenceSetAnnotations
884 * @param vSequenceSetAnnotations
886 public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
887 throws java.lang.IndexOutOfBoundsException
889 //-- check bounds for index
890 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
891 throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
893 _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index);
894 } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
897 * Method setSequenceSetAnnotations
901 * @param sequenceSetAnnotationsArray
903 public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray)
906 _sequenceSetAnnotationsList.removeAllElements();
907 for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) {
908 _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]);
910 } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
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)
952 * @return SequenceSet
954 public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader)
955 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
957 return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader);
958 } //-- org.vamsas.objects.core.SequenceSet 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()