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 Alignment extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
41 * Field _alignmentAnnotations
43 private org.vamsas.client.objects.AlignmentAnnotations _alignmentAnnotations;
48 private java.util.Vector _treeList;
51 * Field _alignmentSequenceList
53 private java.util.Vector _alignmentSequenceList;
58 private org.vamsas.client.objects.Provenance _provenance;
68 _treeList = new Vector();
69 _alignmentSequenceList = new Vector();
70 } //-- org.vamsas.client.objects.Alignment()
78 * Method addAlignmentSequence
82 * @param vAlignmentSequence
84 public void addAlignmentSequence(org.vamsas.client.objects.AlignmentSequence vAlignmentSequence)
85 throws java.lang.IndexOutOfBoundsException
87 _alignmentSequenceList.addElement(vAlignmentSequence);
88 } //-- void addAlignmentSequence(org.vamsas.client.objects.AlignmentSequence)
91 * Method addAlignmentSequence
96 * @param vAlignmentSequence
98 public void addAlignmentSequence(int index, org.vamsas.client.objects.AlignmentSequence vAlignmentSequence)
99 throws java.lang.IndexOutOfBoundsException
101 _alignmentSequenceList.insertElementAt(vAlignmentSequence, index);
102 } //-- void addAlignmentSequence(int, org.vamsas.client.objects.AlignmentSequence)
111 public void addTree(org.vamsas.client.objects.Tree vTree)
112 throws java.lang.IndexOutOfBoundsException
114 _treeList.addElement(vTree);
115 } //-- void addTree(org.vamsas.client.objects.Tree)
125 public void addTree(int index, org.vamsas.client.objects.Tree vTree)
126 throws java.lang.IndexOutOfBoundsException
128 _treeList.insertElementAt(vTree, index);
129 } //-- void addTree(int, org.vamsas.client.objects.Tree)
132 * Method enumerateAlignmentSequence
136 * @return Enumeration
138 public java.util.Enumeration enumerateAlignmentSequence()
140 return _alignmentSequenceList.elements();
141 } //-- java.util.Enumeration enumerateAlignmentSequence()
144 * Method enumerateTree
148 * @return Enumeration
150 public java.util.Enumeration enumerateTree()
152 return _treeList.elements();
153 } //-- java.util.Enumeration enumerateTree()
156 * Note: hashCode() has not been overriden
161 public boolean equals(java.lang.Object obj)
166 if (super.equals(obj)==false)
169 if (obj instanceof Alignment) {
171 Alignment temp = (Alignment)obj;
172 if (this._alignmentAnnotations != null) {
173 if (temp._alignmentAnnotations == null) return false;
174 else if (!(this._alignmentAnnotations.equals(temp._alignmentAnnotations)))
177 else if (temp._alignmentAnnotations != null)
179 if (this._treeList != null) {
180 if (temp._treeList == null) return false;
181 else if (!(this._treeList.equals(temp._treeList)))
184 else if (temp._treeList != null)
186 if (this._alignmentSequenceList != null) {
187 if (temp._alignmentSequenceList == null) return false;
188 else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList)))
191 else if (temp._alignmentSequenceList != null)
193 if (this._provenance != null) {
194 if (temp._provenance == null) return false;
195 else if (!(this._provenance.equals(temp._provenance)))
198 else if (temp._provenance != null)
203 } //-- boolean equals(java.lang.Object)
206 * Returns the value of field 'alignmentAnnotations'.
208 * @return AlignmentAnnotations
209 * @return the value of field 'alignmentAnnotations'.
211 public org.vamsas.client.objects.AlignmentAnnotations getAlignmentAnnotations()
213 return this._alignmentAnnotations;
214 } //-- org.vamsas.client.objects.AlignmentAnnotations getAlignmentAnnotations()
217 * Method getAlignmentSequence
222 * @return AlignmentSequence
224 public org.vamsas.client.objects.AlignmentSequence getAlignmentSequence(int index)
225 throws java.lang.IndexOutOfBoundsException
227 //-- check bounds for index
228 if ((index < 0) || (index > _alignmentSequenceList.size())) {
229 throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
232 return (org.vamsas.client.objects.AlignmentSequence) _alignmentSequenceList.elementAt(index);
233 } //-- org.vamsas.client.objects.AlignmentSequence getAlignmentSequence(int)
236 * Method getAlignmentSequence
240 * @return AlignmentSequence
242 public org.vamsas.client.objects.AlignmentSequence[] getAlignmentSequence()
244 int size = _alignmentSequenceList.size();
245 org.vamsas.client.objects.AlignmentSequence[] mArray = new org.vamsas.client.objects.AlignmentSequence[size];
246 for (int index = 0; index < size; index++) {
247 mArray[index] = (org.vamsas.client.objects.AlignmentSequence) _alignmentSequenceList.elementAt(index);
250 } //-- org.vamsas.client.objects.AlignmentSequence[] getAlignmentSequence()
253 * Method getAlignmentSequenceAsReference
255 * Returns a reference to 'alignmentSequence'. No type checking
256 * is performed on any modications to the Vector.
259 * @return returns a reference to the Vector.
261 public java.util.Vector getAlignmentSequenceAsReference()
263 return _alignmentSequenceList;
264 } //-- java.util.Vector getAlignmentSequenceAsReference()
267 * Method getAlignmentSequenceCount
273 public int getAlignmentSequenceCount()
275 return _alignmentSequenceList.size();
276 } //-- int getAlignmentSequenceCount()
279 * Returns the value of field 'provenance'.
282 * @return the value of field 'provenance'.
284 public org.vamsas.client.objects.Provenance getProvenance()
286 return this._provenance;
287 } //-- org.vamsas.client.objects.Provenance getProvenance()
297 public org.vamsas.client.objects.Tree getTree(int index)
298 throws java.lang.IndexOutOfBoundsException
300 //-- check bounds for index
301 if ((index < 0) || (index > _treeList.size())) {
302 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
305 return (org.vamsas.client.objects.Tree) _treeList.elementAt(index);
306 } //-- org.vamsas.client.objects.Tree getTree(int)
315 public org.vamsas.client.objects.Tree[] getTree()
317 int size = _treeList.size();
318 org.vamsas.client.objects.Tree[] mArray = new org.vamsas.client.objects.Tree[size];
319 for (int index = 0; index < size; index++) {
320 mArray[index] = (org.vamsas.client.objects.Tree) _treeList.elementAt(index);
323 } //-- org.vamsas.client.objects.Tree[] getTree()
326 * Method getTreeAsReference
328 * Returns a reference to 'tree'. No type checking is performed
329 * on any modications to the Vector.
332 * @return returns a reference to the Vector.
334 public java.util.Vector getTreeAsReference()
337 } //-- java.util.Vector getTreeAsReference()
340 * Method getTreeCount
346 public int getTreeCount()
348 return _treeList.size();
349 } //-- int getTreeCount()
358 public boolean isValid()
363 catch (org.exolab.castor.xml.ValidationException vex) {
367 } //-- boolean isValid()
376 public void marshal(java.io.Writer out)
377 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
380 Marshaller.marshal(this, out);
381 } //-- void marshal(java.io.Writer)
390 public void marshal(org.xml.sax.ContentHandler handler)
391 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
394 Marshaller.marshal(this, handler);
395 } //-- void marshal(org.xml.sax.ContentHandler)
398 * Method removeAlignmentSequence
403 * @return AlignmentSequence
405 public org.vamsas.client.objects.AlignmentSequence removeAlignmentSequence(int index)
407 java.lang.Object obj = _alignmentSequenceList.elementAt(index);
408 _alignmentSequenceList.removeElementAt(index);
409 return (org.vamsas.client.objects.AlignmentSequence) obj;
410 } //-- org.vamsas.client.objects.AlignmentSequence removeAlignmentSequence(int)
413 * Method removeAllAlignmentSequence
416 public void removeAllAlignmentSequence()
418 _alignmentSequenceList.removeAllElements();
419 } //-- void removeAllAlignmentSequence()
422 * Method removeAllTree
425 public void removeAllTree()
427 _treeList.removeAllElements();
428 } //-- void removeAllTree()
438 public org.vamsas.client.objects.Tree removeTree(int index)
440 java.lang.Object obj = _treeList.elementAt(index);
441 _treeList.removeElementAt(index);
442 return (org.vamsas.client.objects.Tree) obj;
443 } //-- org.vamsas.client.objects.Tree removeTree(int)
446 * Sets the value of field 'alignmentAnnotations'.
448 * @param alignmentAnnotations the value of field
449 * 'alignmentAnnotations'.
451 public void setAlignmentAnnotations(org.vamsas.client.objects.AlignmentAnnotations alignmentAnnotations)
453 this._alignmentAnnotations = alignmentAnnotations;
454 } //-- void setAlignmentAnnotations(org.vamsas.client.objects.AlignmentAnnotations)
457 * Method setAlignmentSequence
462 * @param vAlignmentSequence
464 public void setAlignmentSequence(int index, org.vamsas.client.objects.AlignmentSequence vAlignmentSequence)
465 throws java.lang.IndexOutOfBoundsException
467 //-- check bounds for index
468 if ((index < 0) || (index > _alignmentSequenceList.size())) {
469 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
471 _alignmentSequenceList.setElementAt(vAlignmentSequence, index);
472 } //-- void setAlignmentSequence(int, org.vamsas.client.objects.AlignmentSequence)
475 * Method setAlignmentSequence
479 * @param alignmentSequenceArray
481 public void setAlignmentSequence(org.vamsas.client.objects.AlignmentSequence[] alignmentSequenceArray)
484 _alignmentSequenceList.removeAllElements();
485 for (int i = 0; i < alignmentSequenceArray.length; i++) {
486 _alignmentSequenceList.addElement(alignmentSequenceArray[i]);
488 } //-- void setAlignmentSequence(org.vamsas.client.objects.AlignmentSequence)
491 * Method setAlignmentSequence
493 * Sets the value of 'alignmentSequence' by copying the given
496 * @param alignmentSequenceVector the Vector to copy.
498 public void setAlignmentSequence(java.util.Vector alignmentSequenceVector)
501 _alignmentSequenceList.removeAllElements();
502 for (int i = 0; i < alignmentSequenceVector.size(); i++) {
503 _alignmentSequenceList.addElement((org.vamsas.client.objects.AlignmentSequence)alignmentSequenceVector.elementAt(i));
505 } //-- void setAlignmentSequence(java.util.Vector)
508 * Method setAlignmentSequenceAsReference
510 * Sets the value of 'alignmentSequence' by setting it to the
511 * given Vector. No type checking is performed.
513 * @param alignmentSequenceVector the Vector to copy.
515 public void setAlignmentSequenceAsReference(java.util.Vector alignmentSequenceVector)
517 _alignmentSequenceList = alignmentSequenceVector;
518 } //-- void setAlignmentSequenceAsReference(java.util.Vector)
521 * Sets the value of field 'provenance'.
523 * @param provenance the value of field 'provenance'.
525 public void setProvenance(org.vamsas.client.objects.Provenance provenance)
527 this._provenance = provenance;
528 } //-- void setProvenance(org.vamsas.client.objects.Provenance)
538 public void setTree(int index, org.vamsas.client.objects.Tree vTree)
539 throws java.lang.IndexOutOfBoundsException
541 //-- check bounds for index
542 if ((index < 0) || (index > _treeList.size())) {
543 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
545 _treeList.setElementAt(vTree, index);
546 } //-- void setTree(int, org.vamsas.client.objects.Tree)
555 public void setTree(org.vamsas.client.objects.Tree[] treeArray)
558 _treeList.removeAllElements();
559 for (int i = 0; i < treeArray.length; i++) {
560 _treeList.addElement(treeArray[i]);
562 } //-- void setTree(org.vamsas.client.objects.Tree)
567 * Sets the value of 'tree' by copying the given Vector.
569 * @param treeVector the Vector to copy.
571 public void setTree(java.util.Vector treeVector)
574 _treeList.removeAllElements();
575 for (int i = 0; i < treeVector.size(); i++) {
576 _treeList.addElement((org.vamsas.client.objects.Tree)treeVector.elementAt(i));
578 } //-- void setTree(java.util.Vector)
581 * Method setTreeAsReference
583 * Sets the value of 'tree' by setting it to the given Vector.
584 * No type checking is performed.
586 * @param treeVector the Vector to copy.
588 public void setTreeAsReference(java.util.Vector treeVector)
590 _treeList = treeVector;
591 } //-- void setTreeAsReference(java.util.Vector)
601 public static org.vamsas.client.objects.Alignment unmarshal(java.io.Reader reader)
602 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
604 return (org.vamsas.client.objects.Alignment) Unmarshaller.unmarshal(org.vamsas.client.objects.Alignment.class, reader);
605 } //-- org.vamsas.client.objects.Alignment unmarshal(java.io.Reader)
611 public void validate()
612 throws org.exolab.castor.xml.ValidationException
614 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
615 validator.validate(this);
616 } //-- void validate()