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 org.vamsas.objects.core.Tree _tree;
83 private org.vamsas.objects.core.Provenance _provenance;
93 _sequenceList = new Vector();
94 _sequenceSetAnnotationsList = new Vector();
95 _alignmentList = new Vector();
96 } //-- org.vamsas.objects.core.SequenceSet()
104 * Method addAlignment
110 public void addAlignment(org.vamsas.objects.core.Alignment vAlignment)
111 throws java.lang.IndexOutOfBoundsException
113 _alignmentList.addElement(vAlignment);
114 } //-- void addAlignment(org.vamsas.objects.core.Alignment)
117 * Method addAlignment
124 public void addAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
125 throws java.lang.IndexOutOfBoundsException
127 _alignmentList.insertElementAt(vAlignment, index);
128 } //-- void addAlignment(int, org.vamsas.objects.core.Alignment)
137 public void addSequence(org.vamsas.objects.core.Sequence vSequence)
138 throws java.lang.IndexOutOfBoundsException
140 _sequenceList.addElement(vSequence);
141 } //-- void addSequence(org.vamsas.objects.core.Sequence)
151 public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence)
152 throws java.lang.IndexOutOfBoundsException
154 _sequenceList.insertElementAt(vSequence, index);
155 } //-- void addSequence(int, org.vamsas.objects.core.Sequence)
158 * Method addSequenceSetAnnotations
162 * @param vSequenceSetAnnotations
164 public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
165 throws java.lang.IndexOutOfBoundsException
167 _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations);
168 } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
171 * Method addSequenceSetAnnotations
176 * @param vSequenceSetAnnotations
178 public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
179 throws java.lang.IndexOutOfBoundsException
181 _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index);
182 } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
185 * Method deleteAligned
188 public void deleteAligned()
190 this._has_aligned= false;
191 } //-- void deleteAligned()
194 * Method enumerateAlignment
198 * @return Enumeration
200 public java.util.Enumeration enumerateAlignment()
202 return _alignmentList.elements();
203 } //-- java.util.Enumeration enumerateAlignment()
206 * Method enumerateSequence
210 * @return Enumeration
212 public java.util.Enumeration enumerateSequence()
214 return _sequenceList.elements();
215 } //-- java.util.Enumeration enumerateSequence()
218 * Method enumerateSequenceSetAnnotations
222 * @return Enumeration
224 public java.util.Enumeration enumerateSequenceSetAnnotations()
226 return _sequenceSetAnnotationsList.elements();
227 } //-- java.util.Enumeration enumerateSequenceSetAnnotations()
230 * Note: hashCode() has not been overriden
235 public boolean equals(java.lang.Object obj)
240 if (super.equals(obj)==false)
243 if (obj instanceof SequenceSet) {
245 SequenceSet temp = (SequenceSet)obj;
246 if (this._gapChar != null) {
247 if (temp._gapChar == null) return false;
248 else if (!(this._gapChar.equals(temp._gapChar)))
251 else if (temp._gapChar != null)
253 if (this._aligned != temp._aligned)
255 if (this._has_aligned != temp._has_aligned)
257 if (this._id != null) {
258 if (temp._id == null) return false;
259 else if (!(this._id.equals(temp._id)))
262 else if (temp._id != null)
264 if (this._sequenceList != null) {
265 if (temp._sequenceList == null) return false;
266 else if (!(this._sequenceList.equals(temp._sequenceList)))
269 else if (temp._sequenceList != null)
271 if (this._sequenceSetAnnotationsList != null) {
272 if (temp._sequenceSetAnnotationsList == null) return false;
273 else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList)))
276 else if (temp._sequenceSetAnnotationsList != null)
278 if (this._alignmentList != null) {
279 if (temp._alignmentList == null) return false;
280 else if (!(this._alignmentList.equals(temp._alignmentList)))
283 else if (temp._alignmentList != null)
285 if (this._tree != null) {
286 if (temp._tree == null) return false;
287 else if (!(this._tree.equals(temp._tree)))
290 else if (temp._tree != null)
292 if (this._provenance != null) {
293 if (temp._provenance == null) return false;
294 else if (!(this._provenance.equals(temp._provenance)))
297 else if (temp._provenance != null)
302 } //-- boolean equals(java.lang.Object)
305 * Returns the value of field 'aligned'.
308 * @return the value of field 'aligned'.
310 public boolean getAligned()
312 return this._aligned;
313 } //-- boolean getAligned()
316 * Method getAlignment
323 public org.vamsas.objects.core.Alignment getAlignment(int index)
324 throws java.lang.IndexOutOfBoundsException
326 //-- check bounds for index
327 if ((index < 0) || (index > _alignmentList.size())) {
328 throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
331 return (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
332 } //-- org.vamsas.objects.core.Alignment getAlignment(int)
335 * Method getAlignment
341 public org.vamsas.objects.core.Alignment[] getAlignment()
343 int size = _alignmentList.size();
344 org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size];
345 for (int index = 0; index < size; index++) {
346 mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index);
349 } //-- org.vamsas.objects.core.Alignment[] getAlignment()
352 * Method getAlignmentCount
358 public int getAlignmentCount()
360 return _alignmentList.size();
361 } //-- int getAlignmentCount()
364 * Returns the value of field 'gapChar'.
367 * @return the value of field 'gapChar'.
369 public java.lang.String getGapChar()
371 return this._gapChar;
372 } //-- java.lang.String getGapChar()
375 * Returns the value of field 'id'.
378 * @return the value of field 'id'.
380 public java.lang.String getId()
383 } //-- java.lang.String getId()
386 * Returns the value of field 'provenance'.
389 * @return the value of field 'provenance'.
391 public org.vamsas.objects.core.Provenance getProvenance()
393 return this._provenance;
394 } //-- org.vamsas.objects.core.Provenance getProvenance()
404 public org.vamsas.objects.core.Sequence getSequence(int index)
405 throws java.lang.IndexOutOfBoundsException
407 //-- check bounds for index
408 if ((index < 0) || (index > _sequenceList.size())) {
409 throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
412 return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
413 } //-- org.vamsas.objects.core.Sequence getSequence(int)
422 public org.vamsas.objects.core.Sequence[] getSequence()
424 int size = _sequenceList.size();
425 org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size];
426 for (int index = 0; index < size; index++) {
427 mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index);
430 } //-- org.vamsas.objects.core.Sequence[] getSequence()
433 * Method getSequenceCount
439 public int getSequenceCount()
441 return _sequenceList.size();
442 } //-- int getSequenceCount()
445 * Method getSequenceSetAnnotations
450 * @return SequenceSetAnnotations
452 public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index)
453 throws java.lang.IndexOutOfBoundsException
455 //-- check bounds for index
456 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
457 throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
460 return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
461 } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int)
464 * Method getSequenceSetAnnotations
468 * @return SequenceSetAnnotations
470 public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
472 int size = _sequenceSetAnnotationsList.size();
473 org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size];
474 for (int index = 0; index < size; index++) {
475 mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index);
478 } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations()
481 * Method getSequenceSetAnnotationsCount
487 public int getSequenceSetAnnotationsCount()
489 return _sequenceSetAnnotationsList.size();
490 } //-- int getSequenceSetAnnotationsCount()
493 * Returns the value of field 'tree'.
496 * @return the value of field 'tree'.
498 public org.vamsas.objects.core.Tree getTree()
501 } //-- org.vamsas.objects.core.Tree getTree()
510 public boolean hasAligned()
512 return this._has_aligned;
513 } //-- boolean hasAligned()
522 public boolean isValid()
527 catch (org.exolab.castor.xml.ValidationException vex) {
531 } //-- boolean isValid()
540 public void marshal(java.io.Writer out)
541 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
544 Marshaller.marshal(this, out);
545 } //-- void marshal(java.io.Writer)
554 public void marshal(org.xml.sax.ContentHandler handler)
555 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
558 Marshaller.marshal(this, handler);
559 } //-- void marshal(org.xml.sax.ContentHandler)
562 * Method removeAlignment
569 public org.vamsas.objects.core.Alignment removeAlignment(int index)
571 java.lang.Object obj = _alignmentList.elementAt(index);
572 _alignmentList.removeElementAt(index);
573 return (org.vamsas.objects.core.Alignment) obj;
574 } //-- org.vamsas.objects.core.Alignment removeAlignment(int)
577 * Method removeAllAlignment
580 public void removeAllAlignment()
582 _alignmentList.removeAllElements();
583 } //-- void removeAllAlignment()
586 * Method removeAllSequence
589 public void removeAllSequence()
591 _sequenceList.removeAllElements();
592 } //-- void removeAllSequence()
595 * Method removeAllSequenceSetAnnotations
598 public void removeAllSequenceSetAnnotations()
600 _sequenceSetAnnotationsList.removeAllElements();
601 } //-- void removeAllSequenceSetAnnotations()
604 * Method removeSequence
611 public org.vamsas.objects.core.Sequence removeSequence(int index)
613 java.lang.Object obj = _sequenceList.elementAt(index);
614 _sequenceList.removeElementAt(index);
615 return (org.vamsas.objects.core.Sequence) obj;
616 } //-- org.vamsas.objects.core.Sequence removeSequence(int)
619 * Method removeSequenceSetAnnotations
624 * @return SequenceSetAnnotations
626 public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index)
628 java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index);
629 _sequenceSetAnnotationsList.removeElementAt(index);
630 return (org.vamsas.objects.core.SequenceSetAnnotations) obj;
631 } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int)
634 * Sets the value of field 'aligned'.
636 * @param aligned the value of field 'aligned'.
638 public void setAligned(boolean aligned)
640 this._aligned = aligned;
641 this._has_aligned = true;
642 } //-- void setAligned(boolean)
645 * Method setAlignment
652 public void setAlignment(int index, org.vamsas.objects.core.Alignment vAlignment)
653 throws java.lang.IndexOutOfBoundsException
655 //-- check bounds for index
656 if ((index < 0) || (index > _alignmentList.size())) {
657 throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]");
659 _alignmentList.setElementAt(vAlignment, index);
660 } //-- void setAlignment(int, org.vamsas.objects.core.Alignment)
663 * Method setAlignment
667 * @param alignmentArray
669 public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray)
672 _alignmentList.removeAllElements();
673 for (int i = 0; i < alignmentArray.length; i++) {
674 _alignmentList.addElement(alignmentArray[i]);
676 } //-- void setAlignment(org.vamsas.objects.core.Alignment)
679 * Sets the value of field 'gapChar'.
681 * @param gapChar the value of field 'gapChar'.
683 public void setGapChar(java.lang.String gapChar)
685 this._gapChar = gapChar;
686 } //-- void setGapChar(java.lang.String)
689 * Sets the value of field 'id'.
691 * @param id the value of field 'id'.
693 public void setId(java.lang.String id)
696 } //-- void setId(java.lang.String)
699 * Sets the value of field 'provenance'.
701 * @param provenance the value of field 'provenance'.
703 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
705 this._provenance = provenance;
706 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
716 public void setSequence(int index, org.vamsas.objects.core.Sequence vSequence)
717 throws java.lang.IndexOutOfBoundsException
719 //-- check bounds for index
720 if ((index < 0) || (index > _sequenceList.size())) {
721 throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]");
723 _sequenceList.setElementAt(vSequence, index);
724 } //-- void setSequence(int, org.vamsas.objects.core.Sequence)
731 * @param sequenceArray
733 public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray)
736 _sequenceList.removeAllElements();
737 for (int i = 0; i < sequenceArray.length; i++) {
738 _sequenceList.addElement(sequenceArray[i]);
740 } //-- void setSequence(org.vamsas.objects.core.Sequence)
743 * Method setSequenceSetAnnotations
748 * @param vSequenceSetAnnotations
750 public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations)
751 throws java.lang.IndexOutOfBoundsException
753 //-- check bounds for index
754 if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) {
755 throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]");
757 _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index);
758 } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations)
761 * Method setSequenceSetAnnotations
765 * @param sequenceSetAnnotationsArray
767 public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray)
770 _sequenceSetAnnotationsList.removeAllElements();
771 for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) {
772 _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]);
774 } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations)
777 * Sets the value of field 'tree'.
779 * @param tree the value of field 'tree'.
781 public void setTree(org.vamsas.objects.core.Tree tree)
784 } //-- void setTree(org.vamsas.objects.core.Tree)
792 * @return SequenceSet
794 public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader)
795 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
797 return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader);
798 } //-- org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader)
804 public void validate()
805 throws org.exolab.castor.xml.ValidationException
807 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
808 validator.validate(this);
809 } //-- void validate()