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.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.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.objects.core.Tree _tree;
78 private org.vamsas.objects.core.Provenance _provenance;
88 _sequenceList = new Vector();
89 _sequenceSetAnnotationsList = new Vector();
90 _alignmentList = new Vector();
91 } //-- org.vamsas.objects.core.SequenceSet()
105 public void addAlignment(org.vamsas.objects.core.Alignment vAlignment)
106 throws java.lang.IndexOutOfBoundsException
108 _alignmentList.addElement(vAlignment);
109 } //-- void addAlignment(org.vamsas.objects.core.Alignment)
112 * Method addAlignment
119 public void addAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
120 throws java.lang.IndexOutOfBoundsException
122 _alignmentList.insertElementAt(vAlignment, index);
123 } //-- void addAlignment(int, org.vamsas.objects.core.Alignment)
132 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
133 throws java.lang.IndexOutOfBoundsException
135 _sequenceList.addElement(vSequence);
136 } //-- void addSequence(org.vamsas.objects.core.Sequence)
146 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
147 throws java.lang.IndexOutOfBoundsException
149 _sequenceList.insertElementAt(vSequence, index);
150 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
153 * Method addSequenceSetAnnotations
157 * @param vSequenceSetAnnotations
159 public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
160 throws java.lang.IndexOutOfBoundsException
162 _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations);
163 } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
166 * Method addSequenceSetAnnotations
171 * @param vSequenceSetAnnotations
173 public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
174 throws java.lang.IndexOutOfBoundsException
176 _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index);
177 } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.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.objects.core.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.objects.core.Alignment) _alignmentList.elementAt(index);
320 } //-- org.vamsas.objects.core.Alignment getAlignment(int)
323 * Method getAlignment
329 public org.vamsas.objects.core.Alignment[] getAlignment()
331 int size = _alignmentList.size();
332 org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size];
333 for (int index = 0; index < size; index++) {
334 mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
337 } //-- org.vamsas.objects.core.Alignment[] getAlignment()
340 * Method getAlignmentCount
346 public int getAlignmentCount()
348 return _alignmentList.size();
349 } //-- int getAlignmentCount()
352 * Returns the value of field 'gapChar'.
355 * @return the value of field 'gapChar'.
357 public java.lang.String getGapChar()
359 return this._gapChar;
360 } //-- java.lang.String getGapChar()
363 * Returns the value of field 'provenance'.
366 * @return the value of field 'provenance'.
368 public org.vamsas.objects.core.Provenance getProvenance()
370 return this._provenance;
371 } //-- org.vamsas.objects.core.Provenance getProvenance()
381 public org.vamsas.objects.core.Sequence getSequence(int index)
382 throws java.lang.IndexOutOfBoundsException
384 //-- check bounds for index
385 if ((index < 0) || (index > _sequenceList.size())) {
386 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
389 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
390 } //-- org.vamsas.objects.core.Sequence getSequence(int)
399 public org.vamsas.objects.core.Sequence[] getSequence()
401 int size = _sequenceList.size();
402 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
403 for (int index = 0; index < size; index++) {
404 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
407 } //-- org.vamsas.objects.core.Sequence[] getSequence()
410 * Method getSequenceCount
416 public int getSequenceCount()
418 return _sequenceList.size();
419 } //-- int getSequenceCount()
422 * Method getSequenceSetAnnotations
427 * @return SequenceSetAnnotations
429 public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index)
430 throws java.lang.IndexOutOfBoundsException
432 //-- check bounds for index
433 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
434 throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
437 return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
438 } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int)
441 * Method getSequenceSetAnnotations
445 * @return SequenceSetAnnotations
447 public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
449 int size = _sequenceSetAnnotationsList.size();
450 org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size];
451 for (int index = 0; index < size; index++) {
452 mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
455 } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
458 * Method getSequenceSetAnnotationsCount
464 public int getSequenceSetAnnotationsCount()
466 return _sequenceSetAnnotationsList.size();
467 } //-- int getSequenceSetAnnotationsCount()
470 * Returns the value of field 'tree'.
473 * @return the value of field 'tree'.
475 public org.vamsas.objects.core.Tree getTree()
478 } //-- org.vamsas.objects.core.Tree getTree()
487 public boolean hasAligned()
489 return this._has_aligned;
490 } //-- boolean hasAligned()
499 public boolean isValid()
504 catch (org.exolab.castor.xml.ValidationException vex) {
508 } //-- boolean isValid()
517 public void marshal(java.io.Writer out)
518 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
521 Marshaller.marshal(this, out);
522 } //-- void marshal(java.io.Writer)
531 public void marshal(org.xml.sax.ContentHandler handler)
532 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
535 Marshaller.marshal(this, handler);
536 } //-- void marshal(org.xml.sax.ContentHandler)
539 * Method removeAlignment
546 public org.vamsas.objects.core.Alignment removeAlignment(int index)
548 java.lang.Object obj = _alignmentList.elementAt(index);
549 _alignmentList.removeElementAt(index);
550 return (org.vamsas.objects.core.Alignment) obj;
551 } //-- org.vamsas.objects.core.Alignment removeAlignment(int)
554 * Method removeAllAlignment
557 public void removeAllAlignment()
559 _alignmentList.removeAllElements();
560 } //-- void removeAllAlignment()
563 * Method removeAllSequence
566 public void removeAllSequence()
568 _sequenceList.removeAllElements();
569 } //-- void removeAllSequence()
572 * Method removeAllSequenceSetAnnotations
575 public void removeAllSequenceSetAnnotations()
577 _sequenceSetAnnotationsList.removeAllElements();
578 } //-- void removeAllSequenceSetAnnotations()
581 * Method removeSequence
588 public org.vamsas.objects.core.Sequence removeSequence(int index)
590 java.lang.Object obj = _sequenceList.elementAt(index);
591 _sequenceList.removeElementAt(index);
592 return (org.vamsas.objects.core.Sequence) obj;
593 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
596 * Method removeSequenceSetAnnotations
601 * @return SequenceSetAnnotations
603 public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index)
605 java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index);
606 _sequenceSetAnnotationsList.removeElementAt(index);
607 return (org.vamsas.objects.core.SequenceSetAnnotations) obj;
608 } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int)
611 * Sets the value of field 'aligned'.
613 * @param aligned the value of field 'aligned'.
615 public void setAligned(boolean aligned)
617 this._aligned = aligned;
618 this._has_aligned = true;
619 } //-- void setAligned(boolean)
622 * Method setAlignment
629 public void setAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
630 throws java.lang.IndexOutOfBoundsException
632 //-- check bounds for index
633 if ((index < 0) || (index > _alignmentList.size())) {
634 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
636 _alignmentList.setElementAt(vAlignment, index);
637 } //-- void setAlignment(int, org.vamsas.objects.core.Alignment)
640 * Method setAlignment
644 * @param alignmentArray
646 public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray)
649 _alignmentList.removeAllElements();
650 for (int i = 0; i < alignmentArray.length; i++) {
651 _alignmentList.addElement(alignmentArray[i]);
653 } //-- void setAlignment(org.vamsas.objects.core.Alignment)
656 * Sets the value of field 'gapChar'.
658 * @param gapChar the value of field 'gapChar'.
660 public void setGapChar(java.lang.String gapChar)
662 this._gapChar = gapChar;
663 } //-- void setGapChar(java.lang.String)
666 * Sets the value of field 'provenance'.
668 * @param provenance the value of field 'provenance'.
670 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
672 this._provenance = provenance;
673 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
683 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
684 throws java.lang.IndexOutOfBoundsException
686 //-- check bounds for index
687 if ((index < 0) || (index > _sequenceList.size())) {
688 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
690 _sequenceList.setElementAt(vSequence, index);
691 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
698 * @param sequenceArray
700 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
703 _sequenceList.removeAllElements();
704 for (int i = 0; i < sequenceArray.length; i++) {
705 _sequenceList.addElement(sequenceArray[i]);
707 } //-- void setSequence(org.vamsas.objects.core.Sequence)
710 * Method setSequenceSetAnnotations
715 * @param vSequenceSetAnnotations
717 public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
718 throws java.lang.IndexOutOfBoundsException
720 //-- check bounds for index
721 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
722 throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
724 _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index);
725 } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
728 * Method setSequenceSetAnnotations
732 * @param sequenceSetAnnotationsArray
734 public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray)
737 _sequenceSetAnnotationsList.removeAllElements();
738 for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) {
739 _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]);
741 } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
744 * Sets the value of field 'tree'.
746 * @param tree the value of field 'tree'.
748 public void setTree(org.vamsas.objects.core.Tree tree)
751 } //-- void setTree(org.vamsas.objects.core.Tree)
759 * @return SequenceSet
761 public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader)
762 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
764 return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader);
765 } //-- org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader)
771 public void validate()
772 throws org.exolab.castor.xml.ValidationException
774 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
775 validator.validate(this);
776 } //-- void validate()