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 _gapChar;
48 private boolean _aligned;
51 * keeps track of state for field: _aligned
53 private boolean _has_aligned;
58 private java.lang.String _id;
63 private java.util.Vector _sequenceList;
66 * Field _sequenceSetAnnotationsList
68 private java.util.Vector _sequenceSetAnnotationsList;
71 * Field _alignmentList
73 private java.util.Vector _alignmentList;
78 private java.util.Vector _treeList;
83 private org.vamsas.objects.core.Provenance _provenance;
93 _sequenceList = new Vector();
94 _sequenceSetAnnotationsList = new Vector();
95 _alignmentList = new Vector();
96 _treeList = new Vector();
97 } //-- org.vamsas.objects.core.SequenceSet()
105 * Method addAlignment
111 public void addAlignment(org.vamsas.objects.core.Alignment vAlignment)
112 throws java.lang.IndexOutOfBoundsException
114 _alignmentList.addElement(vAlignment);
115 } //-- void addAlignment(org.vamsas.objects.core.Alignment)
118 * Method addAlignment
125 public void addAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
126 throws java.lang.IndexOutOfBoundsException
128 _alignmentList.insertElementAt(vAlignment, index);
129 } //-- void addAlignment(int, org.vamsas.objects.core.Alignment)
138 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
139 throws java.lang.IndexOutOfBoundsException
141 _sequenceList.addElement(vSequence);
142 } //-- void addSequence(org.vamsas.objects.core.Sequence)
152 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
153 throws java.lang.IndexOutOfBoundsException
155 _sequenceList.insertElementAt(vSequence, index);
156 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
159 * Method addSequenceSetAnnotations
163 * @param vSequenceSetAnnotations
165 public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
166 throws java.lang.IndexOutOfBoundsException
168 _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations);
169 } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
172 * Method addSequenceSetAnnotations
177 * @param vSequenceSetAnnotations
179 public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
180 throws java.lang.IndexOutOfBoundsException
182 _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index);
183 } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
192 public void addTree(org.vamsas.objects.core.Tree vTree)
193 throws java.lang.IndexOutOfBoundsException
195 _treeList.addElement(vTree);
196 } //-- void addTree(org.vamsas.objects.core.Tree)
206 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
207 throws java.lang.IndexOutOfBoundsException
209 _treeList.insertElementAt(vTree, index);
210 } //-- void addTree(int, org.vamsas.objects.core.Tree)
213 * Method deleteAligned
216 public void deleteAligned()
218 this._has_aligned= false;
219 } //-- void deleteAligned()
222 * Method enumerateAlignment
226 * @return Enumeration
228 public java.util.Enumeration enumerateAlignment()
230 return _alignmentList.elements();
231 } //-- java.util.Enumeration enumerateAlignment()
234 * Method enumerateSequence
238 * @return Enumeration
240 public java.util.Enumeration enumerateSequence()
242 return _sequenceList.elements();
243 } //-- java.util.Enumeration enumerateSequence()
246 * Method enumerateSequenceSetAnnotations
250 * @return Enumeration
252 public java.util.Enumeration enumerateSequenceSetAnnotations()
254 return _sequenceSetAnnotationsList.elements();
255 } //-- java.util.Enumeration enumerateSequenceSetAnnotations()
258 * Method enumerateTree
262 * @return Enumeration
264 public java.util.Enumeration enumerateTree()
266 return _treeList.elements();
267 } //-- java.util.Enumeration enumerateTree()
270 * Note: hashCode() has not been overriden
275 public boolean equals(java.lang.Object obj)
280 if (super.equals(obj)==false)
283 if (obj instanceof SequenceSet) {
285 SequenceSet temp = (SequenceSet)obj;
286 if (this._gapChar != null) {
287 if (temp._gapChar == null) return false;
288 else if (!(this._gapChar.equals(temp._gapChar)))
291 else if (temp._gapChar != null)
293 if (this._aligned != temp._aligned)
295 if (this._has_aligned != temp._has_aligned)
297 if (this._id != null) {
298 if (temp._id == null) return false;
299 else if (!(this._id.equals(temp._id)))
302 else if (temp._id != null)
304 if (this._sequenceList != null) {
305 if (temp._sequenceList == null) return false;
306 else if (!(this._sequenceList.equals(temp._sequenceList)))
309 else if (temp._sequenceList != null)
311 if (this._sequenceSetAnnotationsList != null) {
312 if (temp._sequenceSetAnnotationsList == null) return false;
313 else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList)))
316 else if (temp._sequenceSetAnnotationsList != null)
318 if (this._alignmentList != null) {
319 if (temp._alignmentList == null) return false;
320 else if (!(this._alignmentList.equals(temp._alignmentList)))
323 else if (temp._alignmentList != null)
325 if (this._treeList != null) {
326 if (temp._treeList == null) return false;
327 else if (!(this._treeList.equals(temp._treeList)))
330 else if (temp._treeList != null)
332 if (this._provenance != null) {
333 if (temp._provenance == null) return false;
334 else if (!(this._provenance.equals(temp._provenance)))
337 else if (temp._provenance != null)
342 } //-- boolean equals(java.lang.Object)
345 * Returns the value of field 'aligned'.
348 * @return the value of field 'aligned'.
350 public boolean getAligned()
352 return this._aligned;
353 } //-- boolean getAligned()
356 * Method getAlignment
363 public org.vamsas.objects.core.Alignment getAlignment(int index)
364 throws java.lang.IndexOutOfBoundsException
366 //-- check bounds for index
367 if ((index < 0) || (index > _alignmentList.size())) {
368 throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
371 return (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
372 } //-- org.vamsas.objects.core.Alignment getAlignment(int)
375 * Method getAlignment
381 public org.vamsas.objects.core.Alignment[] getAlignment()
383 int size = _alignmentList.size();
384 org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size];
385 for (int index = 0; index < size; index++) {
386 mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
389 } //-- org.vamsas.objects.core.Alignment[] getAlignment()
392 * Method getAlignmentCount
398 public int getAlignmentCount()
400 return _alignmentList.size();
401 } //-- int getAlignmentCount()
404 * Returns the value of field 'gapChar'.
407 * @return the value of field 'gapChar'.
409 public java.lang.String getGapChar()
411 return this._gapChar;
412 } //-- java.lang.String getGapChar()
415 * Returns the value of field 'id'.
418 * @return the value of field 'id'.
420 public java.lang.String getId()
423 } //-- java.lang.String getId()
426 * Returns the value of field 'provenance'.
429 * @return the value of field 'provenance'.
431 public org.vamsas.objects.core.Provenance getProvenance()
433 return this._provenance;
434 } //-- org.vamsas.objects.core.Provenance getProvenance()
444 public org.vamsas.objects.core.Sequence getSequence(int index)
445 throws java.lang.IndexOutOfBoundsException
447 //-- check bounds for index
448 if ((index < 0) || (index > _sequenceList.size())) {
449 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
452 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
453 } //-- org.vamsas.objects.core.Sequence getSequence(int)
462 public org.vamsas.objects.core.Sequence[] getSequence()
464 int size = _sequenceList.size();
465 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
466 for (int index = 0; index < size; index++) {
467 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
470 } //-- org.vamsas.objects.core.Sequence[] getSequence()
473 * Method getSequenceCount
479 public int getSequenceCount()
481 return _sequenceList.size();
482 } //-- int getSequenceCount()
485 * Method getSequenceSetAnnotations
490 * @return SequenceSetAnnotations
492 public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index)
493 throws java.lang.IndexOutOfBoundsException
495 //-- check bounds for index
496 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
497 throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
500 return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
501 } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int)
504 * Method getSequenceSetAnnotations
508 * @return SequenceSetAnnotations
510 public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
512 int size = _sequenceSetAnnotationsList.size();
513 org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size];
514 for (int index = 0; index < size; index++) {
515 mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
518 } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
521 * Method getSequenceSetAnnotationsCount
527 public int getSequenceSetAnnotationsCount()
529 return _sequenceSetAnnotationsList.size();
530 } //-- int getSequenceSetAnnotationsCount()
540 public org.vamsas.objects.core.Tree getTree(int index)
541 throws java.lang.IndexOutOfBoundsException
543 //-- check bounds for index
544 if ((index < 0) || (index > _treeList.size())) {
545 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
548 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
549 } //-- org.vamsas.objects.core.Tree getTree(int)
558 public org.vamsas.objects.core.Tree[] getTree()
560 int size = _treeList.size();
561 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
562 for (int index = 0; index < size; index++) {
563 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
566 } //-- org.vamsas.objects.core.Tree[] getTree()
569 * Method getTreeCount
575 public int getTreeCount()
577 return _treeList.size();
578 } //-- int getTreeCount()
587 public boolean hasAligned()
589 return this._has_aligned;
590 } //-- boolean hasAligned()
599 public boolean isValid()
604 catch (org.exolab.castor.xml.ValidationException vex) {
608 } //-- boolean isValid()
617 public void marshal(java.io.Writer out)
618 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
621 Marshaller.marshal(this, out);
622 } //-- void marshal(java.io.Writer)
631 public void marshal(org.xml.sax.ContentHandler handler)
632 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
635 Marshaller.marshal(this, handler);
636 } //-- void marshal(org.xml.sax.ContentHandler)
639 * Method removeAlignment
646 public org.vamsas.objects.core.Alignment removeAlignment(int index)
648 java.lang.Object obj = _alignmentList.elementAt(index);
649 _alignmentList.removeElementAt(index);
650 return (org.vamsas.objects.core.Alignment) obj;
651 } //-- org.vamsas.objects.core.Alignment removeAlignment(int)
654 * Method removeAllAlignment
657 public void removeAllAlignment()
659 _alignmentList.removeAllElements();
660 } //-- void removeAllAlignment()
663 * Method removeAllSequence
666 public void removeAllSequence()
668 _sequenceList.removeAllElements();
669 } //-- void removeAllSequence()
672 * Method removeAllSequenceSetAnnotations
675 public void removeAllSequenceSetAnnotations()
677 _sequenceSetAnnotationsList.removeAllElements();
678 } //-- void removeAllSequenceSetAnnotations()
681 * Method removeAllTree
684 public void removeAllTree()
686 _treeList.removeAllElements();
687 } //-- void removeAllTree()
690 * Method removeSequence
697 public org.vamsas.objects.core.Sequence removeSequence(int index)
699 java.lang.Object obj = _sequenceList.elementAt(index);
700 _sequenceList.removeElementAt(index);
701 return (org.vamsas.objects.core.Sequence) obj;
702 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
705 * Method removeSequenceSetAnnotations
710 * @return SequenceSetAnnotations
712 public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index)
714 java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index);
715 _sequenceSetAnnotationsList.removeElementAt(index);
716 return (org.vamsas.objects.core.SequenceSetAnnotations) obj;
717 } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int)
727 public org.vamsas.objects.core.Tree removeTree(int index)
729 java.lang.Object obj = _treeList.elementAt(index);
730 _treeList.removeElementAt(index);
731 return (org.vamsas.objects.core.Tree) obj;
732 } //-- org.vamsas.objects.core.Tree removeTree(int)
735 * Sets the value of field 'aligned'.
737 * @param aligned the value of field 'aligned'.
739 public void setAligned(boolean aligned)
741 this._aligned = aligned;
742 this._has_aligned = true;
743 } //-- void setAligned(boolean)
746 * Method setAlignment
753 public void setAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
754 throws java.lang.IndexOutOfBoundsException
756 //-- check bounds for index
757 if ((index < 0) || (index > _alignmentList.size())) {
758 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
760 _alignmentList.setElementAt(vAlignment, index);
761 } //-- void setAlignment(int, org.vamsas.objects.core.Alignment)
764 * Method setAlignment
768 * @param alignmentArray
770 public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray)
773 _alignmentList.removeAllElements();
774 for (int i = 0; i < alignmentArray.length; i++) {
775 _alignmentList.addElement(alignmentArray[i]);
777 } //-- void setAlignment(org.vamsas.objects.core.Alignment)
780 * Sets the value of field 'gapChar'.
782 * @param gapChar the value of field 'gapChar'.
784 public void setGapChar(java.lang.String gapChar)
786 this._gapChar = gapChar;
787 } //-- void setGapChar(java.lang.String)
790 * Sets the value of field 'id'.
792 * @param id the value of field 'id'.
794 public void setId(java.lang.String id)
797 } //-- void setId(java.lang.String)
800 * Sets the value of field 'provenance'.
802 * @param provenance the value of field 'provenance'.
804 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
806 this._provenance = provenance;
807 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
817 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
818 throws java.lang.IndexOutOfBoundsException
820 //-- check bounds for index
821 if ((index < 0) || (index > _sequenceList.size())) {
822 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
824 _sequenceList.setElementAt(vSequence, index);
825 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
832 * @param sequenceArray
834 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
837 _sequenceList.removeAllElements();
838 for (int i = 0; i < sequenceArray.length; i++) {
839 _sequenceList.addElement(sequenceArray[i]);
841 } //-- void setSequence(org.vamsas.objects.core.Sequence)
844 * Method setSequenceSetAnnotations
849 * @param vSequenceSetAnnotations
851 public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
852 throws java.lang.IndexOutOfBoundsException
854 //-- check bounds for index
855 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
856 throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
858 _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index);
859 } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
862 * Method setSequenceSetAnnotations
866 * @param sequenceSetAnnotationsArray
868 public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray)
871 _sequenceSetAnnotationsList.removeAllElements();
872 for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) {
873 _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]);
875 } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
885 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
886 throws java.lang.IndexOutOfBoundsException
888 //-- check bounds for index
889 if ((index < 0) || (index > _treeList.size())) {
890 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
892 _treeList.setElementAt(vTree, index);
893 } //-- void setTree(int, org.vamsas.objects.core.Tree)
902 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
905 _treeList.removeAllElements();
906 for (int i = 0; i < treeArray.length; i++) {
907 _treeList.addElement(treeArray[i]);
909 } //-- void setTree(org.vamsas.objects.core.Tree)
917 * @return SequenceSet
919 public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader)
920 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
922 return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader);
923 } //-- org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader)
929 public void validate()
930 throws org.exolab.castor.xml.ValidationException
932 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
933 validator.validate(this);
934 } //-- void validate()