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 _id;
46 * Field _alignmentAnnotations
48 private org.vamsas.objects.core.AlignmentAnnotations _alignmentAnnotations;
53 private java.util.Vector _treeList;
56 * Field _alignmentSequenceList
58 private java.util.Vector _alignmentSequenceList;
63 private org.vamsas.objects.core.Provenance _provenance;
73 _treeList = new Vector();
74 _alignmentSequenceList = new Vector();
75 } //-- org.vamsas.objects.core.Alignment()
83 * Method addAlignmentSequence
87 * @param vAlignmentSequence
89 public void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
90 throws java.lang.IndexOutOfBoundsException
92 _alignmentSequenceList.addElement(vAlignmentSequence);
93 } //-- void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
96 * Method addAlignmentSequence
101 * @param vAlignmentSequence
103 public void addAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
104 throws java.lang.IndexOutOfBoundsException
106 _alignmentSequenceList.insertElementAt(vAlignmentSequence, index);
107 } //-- void addAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
116 public void addTree(org.vamsas.objects.core.Tree vTree)
117 throws java.lang.IndexOutOfBoundsException
119 _treeList.addElement(vTree);
120 } //-- void addTree(org.vamsas.objects.core.Tree)
130 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
131 throws java.lang.IndexOutOfBoundsException
133 _treeList.insertElementAt(vTree, index);
134 } //-- void addTree(int, org.vamsas.objects.core.Tree)
137 * Method enumerateAlignmentSequence
141 * @return Enumeration
143 public java.util.Enumeration enumerateAlignmentSequence()
145 return _alignmentSequenceList.elements();
146 } //-- java.util.Enumeration enumerateAlignmentSequence()
149 * Method enumerateTree
153 * @return Enumeration
155 public java.util.Enumeration enumerateTree()
157 return _treeList.elements();
158 } //-- java.util.Enumeration enumerateTree()
161 * Note: hashCode() has not been overriden
166 public boolean equals(java.lang.Object obj)
171 if (super.equals(obj)==false)
174 if (obj instanceof Alignment) {
176 Alignment temp = (Alignment)obj;
177 if (this._id != null) {
178 if (temp._id == null) return false;
179 else if (!(this._id.equals(temp._id)))
182 else if (temp._id != null)
184 if (this._alignmentAnnotations != null) {
185 if (temp._alignmentAnnotations == null) return false;
186 else if (!(this._alignmentAnnotations.equals(temp._alignmentAnnotations)))
189 else if (temp._alignmentAnnotations != null)
191 if (this._treeList != null) {
192 if (temp._treeList == null) return false;
193 else if (!(this._treeList.equals(temp._treeList)))
196 else if (temp._treeList != null)
198 if (this._alignmentSequenceList != null) {
199 if (temp._alignmentSequenceList == null) return false;
200 else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList)))
203 else if (temp._alignmentSequenceList != null)
205 if (this._provenance != null) {
206 if (temp._provenance == null) return false;
207 else if (!(this._provenance.equals(temp._provenance)))
210 else if (temp._provenance != null)
215 } //-- boolean equals(java.lang.Object)
218 * Returns the value of field 'alignmentAnnotations'.
220 * @return AlignmentAnnotations
221 * @return the value of field 'alignmentAnnotations'.
223 public org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
225 return this._alignmentAnnotations;
226 } //-- org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
229 * Method getAlignmentSequence
234 * @return AlignmentSequence
236 public org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int index)
237 throws java.lang.IndexOutOfBoundsException
239 //-- check bounds for index
240 if ((index < 0) || (index > _alignmentSequenceList.size())) {
241 throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
244 return (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
245 } //-- org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int)
248 * Method getAlignmentSequence
252 * @return AlignmentSequence
254 public org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
256 int size = _alignmentSequenceList.size();
257 org.vamsas.objects.core.AlignmentSequence[] mArray = new org.vamsas.objects.core.AlignmentSequence[size];
258 for (int index = 0; index < size; index++) {
259 mArray[index] = (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
262 } //-- org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
265 * Method getAlignmentSequenceCount
271 public int getAlignmentSequenceCount()
273 return _alignmentSequenceList.size();
274 } //-- int getAlignmentSequenceCount()
277 * Returns the value of field 'id'.
280 * @return the value of field 'id'.
282 public java.lang.String getId()
285 } //-- java.lang.String getId()
288 * Returns the value of field 'provenance'.
291 * @return the value of field 'provenance'.
293 public org.vamsas.objects.core.Provenance getProvenance()
295 return this._provenance;
296 } //-- org.vamsas.objects.core.Provenance getProvenance()
306 public org.vamsas.objects.core.Tree getTree(int index)
307 throws java.lang.IndexOutOfBoundsException
309 //-- check bounds for index
310 if ((index < 0) || (index > _treeList.size())) {
311 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
314 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
315 } //-- org.vamsas.objects.core.Tree getTree(int)
324 public org.vamsas.objects.core.Tree[] getTree()
326 int size = _treeList.size();
327 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
328 for (int index = 0; index < size; index++) {
329 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
332 } //-- org.vamsas.objects.core.Tree[] getTree()
335 * Method getTreeCount
341 public int getTreeCount()
343 return _treeList.size();
344 } //-- int getTreeCount()
353 public boolean isValid()
358 catch (org.exolab.castor.xml.ValidationException vex) {
362 } //-- boolean isValid()
371 public void marshal(java.io.Writer out)
372 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
375 Marshaller.marshal(this, out);
376 } //-- void marshal(java.io.Writer)
385 public void marshal(org.xml.sax.ContentHandler handler)
386 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
389 Marshaller.marshal(this, handler);
390 } //-- void marshal(org.xml.sax.ContentHandler)
393 * Method removeAlignmentSequence
398 * @return AlignmentSequence
400 public org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int index)
402 java.lang.Object obj = _alignmentSequenceList.elementAt(index);
403 _alignmentSequenceList.removeElementAt(index);
404 return (org.vamsas.objects.core.AlignmentSequence) obj;
405 } //-- org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int)
408 * Method removeAllAlignmentSequence
411 public void removeAllAlignmentSequence()
413 _alignmentSequenceList.removeAllElements();
414 } //-- void removeAllAlignmentSequence()
417 * Method removeAllTree
420 public void removeAllTree()
422 _treeList.removeAllElements();
423 } //-- void removeAllTree()
433 public org.vamsas.objects.core.Tree removeTree(int index)
435 java.lang.Object obj = _treeList.elementAt(index);
436 _treeList.removeElementAt(index);
437 return (org.vamsas.objects.core.Tree) obj;
438 } //-- org.vamsas.objects.core.Tree removeTree(int)
441 * Sets the value of field 'alignmentAnnotations'.
443 * @param alignmentAnnotations the value of field
444 * 'alignmentAnnotations'.
446 public void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations alignmentAnnotations)
448 this._alignmentAnnotations = alignmentAnnotations;
449 } //-- void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations)
452 * Method setAlignmentSequence
457 * @param vAlignmentSequence
459 public void setAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
460 throws java.lang.IndexOutOfBoundsException
462 //-- check bounds for index
463 if ((index < 0) || (index > _alignmentSequenceList.size())) {
464 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
466 _alignmentSequenceList.setElementAt(vAlignmentSequence, index);
467 } //-- void setAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
470 * Method setAlignmentSequence
474 * @param alignmentSequenceArray
476 public void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence[] alignmentSequenceArray)
479 _alignmentSequenceList.removeAllElements();
480 for (int i = 0; i < alignmentSequenceArray.length; i++) {
481 _alignmentSequenceList.addElement(alignmentSequenceArray[i]);
483 } //-- void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
486 * Sets the value of field 'id'.
488 * @param id the value of field 'id'.
490 public void setId(java.lang.String id)
493 } //-- void setId(java.lang.String)
496 * Sets the value of field 'provenance'.
498 * @param provenance the value of field 'provenance'.
500 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
502 this._provenance = provenance;
503 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
513 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
514 throws java.lang.IndexOutOfBoundsException
516 //-- check bounds for index
517 if ((index < 0) || (index > _treeList.size())) {
518 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
520 _treeList.setElementAt(vTree, index);
521 } //-- void setTree(int, org.vamsas.objects.core.Tree)
530 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
533 _treeList.removeAllElements();
534 for (int i = 0; i < treeArray.length; i++) {
535 _treeList.addElement(treeArray[i]);
537 } //-- void setTree(org.vamsas.objects.core.Tree)
547 public static org.vamsas.objects.core.Alignment unmarshal(java.io.Reader reader)
548 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
550 return (org.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(org.vamsas.objects.core.Alignment.class, reader);
551 } //-- org.vamsas.objects.core.Alignment unmarshal(java.io.Reader)
557 public void validate()
558 throws org.exolab.castor.xml.ValidationException
560 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
561 validator.validate(this);
562 } //-- void validate()