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 Alignment 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;
61 * Field _alignmentAnnotationsList
63 private java.util.Vector _alignmentAnnotationsList;
68 private java.util.Vector _treeList;
71 * Field _alignmentSequenceList
73 private java.util.Vector _alignmentSequenceList;
78 private org.vamsas.objects.core.Provenance _provenance;
88 _alignmentAnnotationsList = new Vector();
89 _treeList = new Vector();
90 _alignmentSequenceList = new Vector();
91 } //-- org.vamsas.objects.core.Alignment()
99 * Method addAlignmentAnnotations
103 * @param vAlignmentAnnotations
105 public void addAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations vAlignmentAnnotations)
106 throws java.lang.IndexOutOfBoundsException
108 _alignmentAnnotationsList.addElement(vAlignmentAnnotations);
109 } //-- void addAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations)
112 * Method addAlignmentAnnotations
117 * @param vAlignmentAnnotations
119 public void addAlignmentAnnotations(int index, org.vamsas.objects.core.AlignmentAnnotations vAlignmentAnnotations)
120 throws java.lang.IndexOutOfBoundsException
122 _alignmentAnnotationsList.insertElementAt(vAlignmentAnnotations, index);
123 } //-- void addAlignmentAnnotations(int, org.vamsas.objects.core.AlignmentAnnotations)
126 * Method addAlignmentSequence
130 * @param vAlignmentSequence
132 public void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
133 throws java.lang.IndexOutOfBoundsException
135 _alignmentSequenceList.addElement(vAlignmentSequence);
136 } //-- void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
139 * Method addAlignmentSequence
144 * @param vAlignmentSequence
146 public void addAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
147 throws java.lang.IndexOutOfBoundsException
149 _alignmentSequenceList.insertElementAt(vAlignmentSequence, index);
150 } //-- void addAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
159 public void addTree(org.vamsas.objects.core.Tree vTree)
160 throws java.lang.IndexOutOfBoundsException
162 _treeList.addElement(vTree);
163 } //-- void addTree(org.vamsas.objects.core.Tree)
173 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
174 throws java.lang.IndexOutOfBoundsException
176 _treeList.insertElementAt(vTree, index);
177 } //-- void addTree(int, org.vamsas.objects.core.Tree)
180 * Method deleteAligned
183 public void deleteAligned()
185 this._has_aligned= false;
186 } //-- void deleteAligned()
189 * Method enumerateAlignmentAnnotations
193 * @return Enumeration
195 public java.util.Enumeration enumerateAlignmentAnnotations()
197 return _alignmentAnnotationsList.elements();
198 } //-- java.util.Enumeration enumerateAlignmentAnnotations()
201 * Method enumerateAlignmentSequence
205 * @return Enumeration
207 public java.util.Enumeration enumerateAlignmentSequence()
209 return _alignmentSequenceList.elements();
210 } //-- java.util.Enumeration enumerateAlignmentSequence()
213 * Method enumerateTree
217 * @return Enumeration
219 public java.util.Enumeration enumerateTree()
221 return _treeList.elements();
222 } //-- java.util.Enumeration enumerateTree()
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 Alignment) {
240 Alignment temp = (Alignment)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._id != null) {
253 if (temp._id == null) return false;
254 else if (!(this._id.equals(temp._id)))
257 else if (temp._id != null)
259 if (this._alignmentAnnotationsList != null) {
260 if (temp._alignmentAnnotationsList == null) return false;
261 else if (!(this._alignmentAnnotationsList.equals(temp._alignmentAnnotationsList)))
264 else if (temp._alignmentAnnotationsList != null)
266 if (this._treeList != null) {
267 if (temp._treeList == null) return false;
268 else if (!(this._treeList.equals(temp._treeList)))
271 else if (temp._treeList != null)
273 if (this._alignmentSequenceList != null) {
274 if (temp._alignmentSequenceList == null) return false;
275 else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList)))
278 else if (temp._alignmentSequenceList != 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 getAlignmentAnnotations
309 * @return AlignmentAnnotations
311 public org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations(int index)
312 throws java.lang.IndexOutOfBoundsException
314 //-- check bounds for index
315 if ((index < 0) || (index > _alignmentAnnotationsList.size())) {
316 throw new IndexOutOfBoundsException("getAlignmentAnnotations: Index value '"+index+"' not in range [0.."+_alignmentAnnotationsList.size()+ "]");
319 return (org.vamsas.objects.core.AlignmentAnnotations) _alignmentAnnotationsList.elementAt(index);
320 } //-- org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations(int)
323 * Method getAlignmentAnnotations
327 * @return AlignmentAnnotations
329 public org.vamsas.objects.core.AlignmentAnnotations[] getAlignmentAnnotations()
331 int size = _alignmentAnnotationsList.size();
332 org.vamsas.objects.core.AlignmentAnnotations[] mArray = new org.vamsas.objects.core.AlignmentAnnotations[size];
333 for (int index = 0; index < size; index++) {
334 mArray[index] = (org.vamsas.objects.core.AlignmentAnnotations) _alignmentAnnotationsList.elementAt(index);
337 } //-- org.vamsas.objects.core.AlignmentAnnotations[] getAlignmentAnnotations()
340 * Method getAlignmentAnnotationsCount
346 public int getAlignmentAnnotationsCount()
348 return _alignmentAnnotationsList.size();
349 } //-- int getAlignmentAnnotationsCount()
352 * Method getAlignmentSequence
357 * @return AlignmentSequence
359 public org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int index)
360 throws java.lang.IndexOutOfBoundsException
362 //-- check bounds for index
363 if ((index < 0) || (index > _alignmentSequenceList.size())) {
364 throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
367 return (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
368 } //-- org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int)
371 * Method getAlignmentSequence
375 * @return AlignmentSequence
377 public org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
379 int size = _alignmentSequenceList.size();
380 org.vamsas.objects.core.AlignmentSequence[] mArray = new org.vamsas.objects.core.AlignmentSequence[size];
381 for (int index = 0; index < size; index++) {
382 mArray[index] = (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
385 } //-- org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
388 * Method getAlignmentSequenceCount
394 public int getAlignmentSequenceCount()
396 return _alignmentSequenceList.size();
397 } //-- int getAlignmentSequenceCount()
400 * Returns the value of field 'gapChar'.
403 * @return the value of field 'gapChar'.
405 public java.lang.String getGapChar()
407 return this._gapChar;
408 } //-- java.lang.String getGapChar()
411 * Returns the value of field 'id'.
414 * @return the value of field 'id'.
416 public java.lang.String getId()
419 } //-- java.lang.String getId()
422 * Returns the value of field 'provenance'.
425 * @return the value of field 'provenance'.
427 public org.vamsas.objects.core.Provenance getProvenance()
429 return this._provenance;
430 } //-- org.vamsas.objects.core.Provenance getProvenance()
440 public org.vamsas.objects.core.Tree getTree(int index)
441 throws java.lang.IndexOutOfBoundsException
443 //-- check bounds for index
444 if ((index < 0) || (index > _treeList.size())) {
445 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
448 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
449 } //-- org.vamsas.objects.core.Tree getTree(int)
458 public org.vamsas.objects.core.Tree[] getTree()
460 int size = _treeList.size();
461 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
462 for (int index = 0; index < size; index++) {
463 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
466 } //-- org.vamsas.objects.core.Tree[] getTree()
469 * Method getTreeCount
475 public int getTreeCount()
477 return _treeList.size();
478 } //-- int getTreeCount()
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 removeAlignmentAnnotations
544 * @return AlignmentAnnotations
546 public org.vamsas.objects.core.AlignmentAnnotations removeAlignmentAnnotations(int index)
548 java.lang.Object obj = _alignmentAnnotationsList.elementAt(index);
549 _alignmentAnnotationsList.removeElementAt(index);
550 return (org.vamsas.objects.core.AlignmentAnnotations) obj;
551 } //-- org.vamsas.objects.core.AlignmentAnnotations removeAlignmentAnnotations(int)
554 * Method removeAlignmentSequence
559 * @return AlignmentSequence
561 public org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int index)
563 java.lang.Object obj = _alignmentSequenceList.elementAt(index);
564 _alignmentSequenceList.removeElementAt(index);
565 return (org.vamsas.objects.core.AlignmentSequence) obj;
566 } //-- org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int)
569 * Method removeAllAlignmentAnnotations
572 public void removeAllAlignmentAnnotations()
574 _alignmentAnnotationsList.removeAllElements();
575 } //-- void removeAllAlignmentAnnotations()
578 * Method removeAllAlignmentSequence
581 public void removeAllAlignmentSequence()
583 _alignmentSequenceList.removeAllElements();
584 } //-- void removeAllAlignmentSequence()
587 * Method removeAllTree
590 public void removeAllTree()
592 _treeList.removeAllElements();
593 } //-- void removeAllTree()
603 public org.vamsas.objects.core.Tree removeTree(int index)
605 java.lang.Object obj = _treeList.elementAt(index);
606 _treeList.removeElementAt(index);
607 return (org.vamsas.objects.core.Tree) obj;
608 } //-- org.vamsas.objects.core.Tree removeTree(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 setAlignmentAnnotations
627 * @param vAlignmentAnnotations
629 public void setAlignmentAnnotations(int index, org.vamsas.objects.core.AlignmentAnnotations vAlignmentAnnotations)
630 throws java.lang.IndexOutOfBoundsException
632 //-- check bounds for index
633 if ((index < 0) || (index > _alignmentAnnotationsList.size())) {
634 throw new IndexOutOfBoundsException("setAlignmentAnnotations: Index value '"+index+"' not in range [0.."+_alignmentAnnotationsList.size()+ "]");
636 _alignmentAnnotationsList.setElementAt(vAlignmentAnnotations, index);
637 } //-- void setAlignmentAnnotations(int, org.vamsas.objects.core.AlignmentAnnotations)
640 * Method setAlignmentAnnotations
644 * @param alignmentAnnotationsArray
646 public void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations[] alignmentAnnotationsArray)
649 _alignmentAnnotationsList.removeAllElements();
650 for (int i = 0; i < alignmentAnnotationsArray.length; i++) {
651 _alignmentAnnotationsList.addElement(alignmentAnnotationsArray[i]);
653 } //-- void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations)
656 * Method setAlignmentSequence
661 * @param vAlignmentSequence
663 public void setAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
664 throws java.lang.IndexOutOfBoundsException
666 //-- check bounds for index
667 if ((index < 0) || (index > _alignmentSequenceList.size())) {
668 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
670 _alignmentSequenceList.setElementAt(vAlignmentSequence, index);
671 } //-- void setAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
674 * Method setAlignmentSequence
678 * @param alignmentSequenceArray
680 public void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence[] alignmentSequenceArray)
683 _alignmentSequenceList.removeAllElements();
684 for (int i = 0; i < alignmentSequenceArray.length; i++) {
685 _alignmentSequenceList.addElement(alignmentSequenceArray[i]);
687 } //-- void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
690 * Sets the value of field 'gapChar'.
692 * @param gapChar the value of field 'gapChar'.
694 public void setGapChar(java.lang.String gapChar)
696 this._gapChar = gapChar;
697 } //-- void setGapChar(java.lang.String)
700 * Sets the value of field 'id'.
702 * @param id the value of field 'id'.
704 public void setId(java.lang.String id)
707 } //-- void setId(java.lang.String)
710 * Sets the value of field 'provenance'.
712 * @param provenance the value of field 'provenance'.
714 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
716 this._provenance = provenance;
717 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
727 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
728 throws java.lang.IndexOutOfBoundsException
730 //-- check bounds for index
731 if ((index < 0) || (index > _treeList.size())) {
732 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
734 _treeList.setElementAt(vTree, index);
735 } //-- void setTree(int, org.vamsas.objects.core.Tree)
744 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
747 _treeList.removeAllElements();
748 for (int i = 0; i < treeArray.length; i++) {
749 _treeList.addElement(treeArray[i]);
751 } //-- void setTree(org.vamsas.objects.core.Tree)
761 public static org.vamsas.objects.core.Alignment unmarshal(java.io.Reader reader)
762 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
764 return (org.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(org.vamsas.objects.core.Alignment.class, reader);
765 } //-- org.vamsas.objects.core.Alignment 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()