2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M1</a>, using an XML
8 package org.vamsas.client.objects;
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.util.Vector _sequenceList;
61 * Field _sequenceSetAnnotationsList
63 private java.util.Vector _sequenceSetAnnotationsList;
66 * Field _alignmentList
68 private java.util.Vector _alignmentList;
73 private org.vamsas.client.objects.Tree _tree;
78 private org.vamsas.client.objects.Provenance _provenance;
88 _sequenceList = new Vector();
89 _sequenceSetAnnotationsList = new Vector();
90 _alignmentList = new Vector();
91 } //-- org.vamsas.client.objects.SequenceSet()
105 public void addAlignment(org.vamsas.client.objects.Alignment vAlignment)
106 throws java.lang.IndexOutOfBoundsException
108 _alignmentList.addElement(vAlignment);
109 } //-- void addAlignment(org.vamsas.client.objects.Alignment)
112 * Method addAlignment
119 public void addAlignment(int index, org.vamsas.client.objects.Alignment vAlignment)
120 throws java.lang.IndexOutOfBoundsException
122 _alignmentList.insertElementAt(vAlignment, index);
123 } //-- void addAlignment(int, org.vamsas.client.objects.Alignment)
132 public void addSequence(org.vamsas.client.objects.Sequence vSequence)
133 throws java.lang.IndexOutOfBoundsException
135 _sequenceList.addElement(vSequence);
136 } //-- void addSequence(org.vamsas.client.objects.Sequence)
146 public void addSequence(int index, org.vamsas.client.objects.Sequence vSequence)
147 throws java.lang.IndexOutOfBoundsException
149 _sequenceList.insertElementAt(vSequence, index);
150 } //-- void addSequence(int, org.vamsas.client.objects.Sequence)
153 * Method addSequenceSetAnnotations
157 * @param vSequenceSetAnnotations
159 public void addSequenceSetAnnotations(org.vamsas.client.objects.SequenceSetAnnotations vSequenceSetAnnotations)
160 throws java.lang.IndexOutOfBoundsException
162 _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations);
163 } //-- void addSequenceSetAnnotations(org.vamsas.client.objects.SequenceSetAnnotations)
166 * Method addSequenceSetAnnotations
171 * @param vSequenceSetAnnotations
173 public void addSequenceSetAnnotations(int index, org.vamsas.client.objects.SequenceSetAnnotations vSequenceSetAnnotations)
174 throws java.lang.IndexOutOfBoundsException
176 _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index);
177 } //-- void addSequenceSetAnnotations(int, org.vamsas.client.objects.SequenceSetAnnotations)
180 * Method deleteAligned
183 public void deleteAligned()
185 this._has_aligned= false;
186 } //-- void deleteAligned()
189 * Method enumerateAlignment
193 * @return Enumeration
195 public java.util.Enumeration enumerateAlignment()
197 return _alignmentList.elements();
198 } //-- java.util.Enumeration enumerateAlignment()
201 * Method enumerateSequence
205 * @return Enumeration
207 public java.util.Enumeration enumerateSequence()
209 return _sequenceList.elements();
210 } //-- java.util.Enumeration enumerateSequence()
213 * Method enumerateSequenceSetAnnotations
217 * @return Enumeration
219 public java.util.Enumeration enumerateSequenceSetAnnotations()
221 return _sequenceSetAnnotationsList.elements();
222 } //-- java.util.Enumeration enumerateSequenceSetAnnotations()
225 * Note: hashCode() has not been overriden
230 public boolean equals(java.lang.Object obj)
235 if (super.equals(obj)==false)
238 if (obj instanceof SequenceSet) {
240 SequenceSet temp = (SequenceSet)obj;
241 if (this._gapChar != null) {
242 if (temp._gapChar == null) return false;
243 else if (!(this._gapChar.equals(temp._gapChar)))
246 else if (temp._gapChar != null)
248 if (this._aligned != temp._aligned)
250 if (this._has_aligned != temp._has_aligned)
252 if (this._sequenceList != null) {
253 if (temp._sequenceList == null) return false;
254 else if (!(this._sequenceList.equals(temp._sequenceList)))
257 else if (temp._sequenceList != null)
259 if (this._sequenceSetAnnotationsList != null) {
260 if (temp._sequenceSetAnnotationsList == null) return false;
261 else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList)))
264 else if (temp._sequenceSetAnnotationsList != null)
266 if (this._alignmentList != null) {
267 if (temp._alignmentList == null) return false;
268 else if (!(this._alignmentList.equals(temp._alignmentList)))
271 else if (temp._alignmentList != null)
273 if (this._tree != null) {
274 if (temp._tree == null) return false;
275 else if (!(this._tree.equals(temp._tree)))
278 else if (temp._tree != null)
280 if (this._provenance != null) {
281 if (temp._provenance == null) return false;
282 else if (!(this._provenance.equals(temp._provenance)))
285 else if (temp._provenance != null)
290 } //-- boolean equals(java.lang.Object)
293 * Returns the value of field 'aligned'.
296 * @return the value of field 'aligned'.
298 public boolean getAligned()
300 return this._aligned;
301 } //-- boolean getAligned()
304 * Method getAlignment
311 public org.vamsas.client.objects.Alignment getAlignment(int index)
312 throws java.lang.IndexOutOfBoundsException
314 //-- check bounds for index
315 if ((index < 0) || (index > _alignmentList.size())) {
316 throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
319 return (org.vamsas.client.objects.Alignment) _alignmentList.elementAt(index);
320 } //-- org.vamsas.client.objects.Alignment getAlignment(int)
323 * Method getAlignment
329 public org.vamsas.client.objects.Alignment[] getAlignment()
331 int size = _alignmentList.size();
332 org.vamsas.client.objects.Alignment[] mArray = new org.vamsas.client.objects.Alignment[size];
333 for (int index = 0; index < size; index++) {
334 mArray[index] = (org.vamsas.client.objects.Alignment) _alignmentList.elementAt(index);
337 } //-- org.vamsas.client.objects.Alignment[] getAlignment()
340 * Method getAlignmentAsReference
342 * Returns a reference to 'alignment'. No type checking is
343 * performed on any modications to the Vector.
346 * @return returns a reference to the Vector.
348 public java.util.Vector getAlignmentAsReference()
350 return _alignmentList;
351 } //-- java.util.Vector getAlignmentAsReference()
354 * Method getAlignmentCount
360 public int getAlignmentCount()
362 return _alignmentList.size();
363 } //-- int getAlignmentCount()
366 * Returns the value of field 'gapChar'.
369 * @return the value of field 'gapChar'.
371 public java.lang.String getGapChar()
373 return this._gapChar;
374 } //-- java.lang.String getGapChar()
377 * Returns the value of field 'provenance'.
380 * @return the value of field 'provenance'.
382 public org.vamsas.client.objects.Provenance getProvenance()
384 return this._provenance;
385 } //-- org.vamsas.client.objects.Provenance getProvenance()
395 public org.vamsas.client.objects.Sequence getSequence(int index)
396 throws java.lang.IndexOutOfBoundsException
398 //-- check bounds for index
399 if ((index < 0) || (index > _sequenceList.size())) {
400 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
403 return (org.vamsas.client.objects.Sequence) _sequenceList.elementAt(index);
404 } //-- org.vamsas.client.objects.Sequence getSequence(int)
413 public org.vamsas.client.objects.Sequence[] getSequence()
415 int size = _sequenceList.size();
416 org.vamsas.client.objects.Sequence[] mArray = new org.vamsas.client.objects.Sequence[size];
417 for (int index = 0; index < size; index++) {
418 mArray[index] = (org.vamsas.client.objects.Sequence) _sequenceList.elementAt(index);
421 } //-- org.vamsas.client.objects.Sequence[] getSequence()
424 * Method getSequenceAsReference
426 * Returns a reference to 'sequence'. No type checking is
427 * performed on any modications to the Vector.
430 * @return returns a reference to the Vector.
432 public java.util.Vector getSequenceAsReference()
434 return _sequenceList;
435 } //-- java.util.Vector getSequenceAsReference()
438 * Method getSequenceCount
444 public int getSequenceCount()
446 return _sequenceList.size();
447 } //-- int getSequenceCount()
450 * Method getSequenceSetAnnotations
455 * @return SequenceSetAnnotations
457 public org.vamsas.client.objects.SequenceSetAnnotations getSequenceSetAnnotations(int index)
458 throws java.lang.IndexOutOfBoundsException
460 //-- check bounds for index
461 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
462 throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
465 return (org.vamsas.client.objects.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
466 } //-- org.vamsas.client.objects.SequenceSetAnnotations getSequenceSetAnnotations(int)
469 * Method getSequenceSetAnnotations
473 * @return SequenceSetAnnotations
475 public org.vamsas.client.objects.SequenceSetAnnotations[] getSequenceSetAnnotations()
477 int size = _sequenceSetAnnotationsList.size();
478 org.vamsas.client.objects.SequenceSetAnnotations[] mArray = new org.vamsas.client.objects.SequenceSetAnnotations[size];
479 for (int index = 0; index < size; index++) {
480 mArray[index] = (org.vamsas.client.objects.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
483 } //-- org.vamsas.client.objects.SequenceSetAnnotations[] getSequenceSetAnnotations()
486 * Method getSequenceSetAnnotationsAsReference
488 * Returns a reference to 'sequenceSetAnnotations'. No type
489 * checking is performed on any modications to the Vector.
492 * @return returns a reference to the Vector.
494 public java.util.Vector getSequenceSetAnnotationsAsReference()
496 return _sequenceSetAnnotationsList;
497 } //-- java.util.Vector getSequenceSetAnnotationsAsReference()
500 * Method getSequenceSetAnnotationsCount
506 public int getSequenceSetAnnotationsCount()
508 return _sequenceSetAnnotationsList.size();
509 } //-- int getSequenceSetAnnotationsCount()
512 * Returns the value of field 'tree'.
515 * @return the value of field 'tree'.
517 public org.vamsas.client.objects.Tree getTree()
520 } //-- org.vamsas.client.objects.Tree getTree()
529 public boolean hasAligned()
531 return this._has_aligned;
532 } //-- boolean hasAligned()
541 public boolean isValid()
546 catch (org.exolab.castor.xml.ValidationException vex) {
550 } //-- boolean isValid()
559 public void marshal(java.io.Writer out)
560 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
563 Marshaller.marshal(this, out);
564 } //-- void marshal(java.io.Writer)
573 public void marshal(org.xml.sax.ContentHandler handler)
574 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
577 Marshaller.marshal(this, handler);
578 } //-- void marshal(org.xml.sax.ContentHandler)
581 * Method removeAlignment
588 public org.vamsas.client.objects.Alignment removeAlignment(int index)
590 java.lang.Object obj = _alignmentList.elementAt(index);
591 _alignmentList.removeElementAt(index);
592 return (org.vamsas.client.objects.Alignment) obj;
593 } //-- org.vamsas.client.objects.Alignment removeAlignment(int)
596 * Method removeAllAlignment
599 public void removeAllAlignment()
601 _alignmentList.removeAllElements();
602 } //-- void removeAllAlignment()
605 * Method removeAllSequence
608 public void removeAllSequence()
610 _sequenceList.removeAllElements();
611 } //-- void removeAllSequence()
614 * Method removeAllSequenceSetAnnotations
617 public void removeAllSequenceSetAnnotations()
619 _sequenceSetAnnotationsList.removeAllElements();
620 } //-- void removeAllSequenceSetAnnotations()
623 * Method removeSequence
630 public org.vamsas.client.objects.Sequence removeSequence(int index)
632 java.lang.Object obj = _sequenceList.elementAt(index);
633 _sequenceList.removeElementAt(index);
634 return (org.vamsas.client.objects.Sequence) obj;
635 } //-- org.vamsas.client.objects.Sequence removeSequence(int)
638 * Method removeSequenceSetAnnotations
643 * @return SequenceSetAnnotations
645 public org.vamsas.client.objects.SequenceSetAnnotations removeSequenceSetAnnotations(int index)
647 java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index);
648 _sequenceSetAnnotationsList.removeElementAt(index);
649 return (org.vamsas.client.objects.SequenceSetAnnotations) obj;
650 } //-- org.vamsas.client.objects.SequenceSetAnnotations removeSequenceSetAnnotations(int)
653 * Sets the value of field 'aligned'.
655 * @param aligned the value of field 'aligned'.
657 public void setAligned(boolean aligned)
659 this._aligned = aligned;
660 this._has_aligned = true;
661 } //-- void setAligned(boolean)
664 * Method setAlignment
671 public void setAlignment(int index, org.vamsas.client.objects.Alignment vAlignment)
672 throws java.lang.IndexOutOfBoundsException
674 //-- check bounds for index
675 if ((index < 0) || (index > _alignmentList.size())) {
676 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
678 _alignmentList.setElementAt(vAlignment, index);
679 } //-- void setAlignment(int, org.vamsas.client.objects.Alignment)
682 * Method setAlignment
686 * @param alignmentArray
688 public void setAlignment(org.vamsas.client.objects.Alignment[] alignmentArray)
691 _alignmentList.removeAllElements();
692 for (int i = 0; i < alignmentArray.length; i++) {
693 _alignmentList.addElement(alignmentArray[i]);
695 } //-- void setAlignment(org.vamsas.client.objects.Alignment)
698 * Method setAlignment
700 * Sets the value of 'alignment' by copying the given Vector.
702 * @param alignmentVector the Vector to copy.
704 public void setAlignment(java.util.Vector alignmentVector)
707 _alignmentList.removeAllElements();
708 for (int i = 0; i < alignmentVector.size(); i++) {
709 _alignmentList.addElement((org.vamsas.client.objects.Alignment)alignmentVector.elementAt(i));
711 } //-- void setAlignment(java.util.Vector)
714 * Method setAlignmentAsReference
716 * Sets the value of 'alignment' by setting it to the given
717 * Vector. No type checking is performed.
719 * @param alignmentVector the Vector to copy.
721 public void setAlignmentAsReference(java.util.Vector alignmentVector)
723 _alignmentList = alignmentVector;
724 } //-- void setAlignmentAsReference(java.util.Vector)
727 * Sets the value of field 'gapChar'.
729 * @param gapChar the value of field 'gapChar'.
731 public void setGapChar(java.lang.String gapChar)
733 this._gapChar = gapChar;
734 } //-- void setGapChar(java.lang.String)
737 * Sets the value of field 'provenance'.
739 * @param provenance the value of field 'provenance'.
741 public void setProvenance(org.vamsas.client.objects.Provenance provenance)
743 this._provenance = provenance;
744 } //-- void setProvenance(org.vamsas.client.objects.Provenance)
754 public void setSequence(int index, org.vamsas.client.objects.Sequence vSequence)
755 throws java.lang.IndexOutOfBoundsException
757 //-- check bounds for index
758 if ((index < 0) || (index > _sequenceList.size())) {
759 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
761 _sequenceList.setElementAt(vSequence, index);
762 } //-- void setSequence(int, org.vamsas.client.objects.Sequence)
769 * @param sequenceArray
771 public void setSequence(org.vamsas.client.objects.Sequence[] sequenceArray)
774 _sequenceList.removeAllElements();
775 for (int i = 0; i < sequenceArray.length; i++) {
776 _sequenceList.addElement(sequenceArray[i]);
778 } //-- void setSequence(org.vamsas.client.objects.Sequence)
783 * Sets the value of 'sequence' by copying the given Vector.
785 * @param sequenceVector the Vector to copy.
787 public void setSequence(java.util.Vector sequenceVector)
790 _sequenceList.removeAllElements();
791 for (int i = 0; i < sequenceVector.size(); i++) {
792 _sequenceList.addElement((org.vamsas.client.objects.Sequence)sequenceVector.elementAt(i));
794 } //-- void setSequence(java.util.Vector)
797 * Method setSequenceAsReference
799 * Sets the value of 'sequence' by setting it to the given
800 * Vector. No type checking is performed.
802 * @param sequenceVector the Vector to copy.
804 public void setSequenceAsReference(java.util.Vector sequenceVector)
806 _sequenceList = sequenceVector;
807 } //-- void setSequenceAsReference(java.util.Vector)
810 * Method setSequenceSetAnnotations
815 * @param vSequenceSetAnnotations
817 public void setSequenceSetAnnotations(int index, org.vamsas.client.objects.SequenceSetAnnotations vSequenceSetAnnotations)
818 throws java.lang.IndexOutOfBoundsException
820 //-- check bounds for index
821 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
822 throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
824 _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index);
825 } //-- void setSequenceSetAnnotations(int, org.vamsas.client.objects.SequenceSetAnnotations)
828 * Method setSequenceSetAnnotations
832 * @param sequenceSetAnnotationsArray
834 public void setSequenceSetAnnotations(org.vamsas.client.objects.SequenceSetAnnotations[] sequenceSetAnnotationsArray)
837 _sequenceSetAnnotationsList.removeAllElements();
838 for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) {
839 _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]);
841 } //-- void setSequenceSetAnnotations(org.vamsas.client.objects.SequenceSetAnnotations)
844 * Method setSequenceSetAnnotations
846 * Sets the value of 'sequenceSetAnnotations' by copying the
849 * @param sequenceSetAnnotationsVector the Vector to copy.
851 public void setSequenceSetAnnotations(java.util.Vector sequenceSetAnnotationsVector)
854 _sequenceSetAnnotationsList.removeAllElements();
855 for (int i = 0; i < sequenceSetAnnotationsVector.size(); i++) {
856 _sequenceSetAnnotationsList.addElement((org.vamsas.client.objects.SequenceSetAnnotations)sequenceSetAnnotationsVector.elementAt(i));
858 } //-- void setSequenceSetAnnotations(java.util.Vector)
861 * Method setSequenceSetAnnotationsAsReference
863 * Sets the value of 'sequenceSetAnnotations' by setting it to
864 * the given Vector. No type checking is performed.
866 * @param sequenceSetAnnotationsVector the Vector to copy.
868 public void setSequenceSetAnnotationsAsReference(java.util.Vector sequenceSetAnnotationsVector)
870 _sequenceSetAnnotationsList = sequenceSetAnnotationsVector;
871 } //-- void setSequenceSetAnnotationsAsReference(java.util.Vector)
874 * Sets the value of field 'tree'.
876 * @param tree the value of field 'tree'.
878 public void setTree(org.vamsas.client.objects.Tree tree)
881 } //-- void setTree(org.vamsas.client.objects.Tree)
889 * @return SequenceSet
891 public static org.vamsas.client.objects.SequenceSet unmarshal(java.io.Reader reader)
892 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
894 return (org.vamsas.client.objects.SequenceSet) Unmarshaller.unmarshal(org.vamsas.client.objects.SequenceSet.class, reader);
895 } //-- org.vamsas.client.objects.SequenceSet unmarshal(java.io.Reader)
901 public void validate()
902 throws org.exolab.castor.xml.ValidationException
904 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
905 validator.validate(this);
906 } //-- void validate()