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 Alignment extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
41 * Field _alignmentAnnotations
43 private org.vamsas.objects.core.AlignmentAnnotations _alignmentAnnotations;
48 private java.util.Vector _treeList;
51 * Field _alignmentSequenceList
53 private java.util.Vector _alignmentSequenceList;
58 private org.vamsas.objects.core.Provenance _provenance;
68 _treeList = new Vector();
69 _alignmentSequenceList = new Vector();
70 } //-- org.vamsas.objects.core.Alignment()
78 * Method addAlignmentSequence
82 * @param vAlignmentSequence
84 public void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
85 throws java.lang.IndexOutOfBoundsException
87 _alignmentSequenceList.addElement(vAlignmentSequence);
88 } //-- void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
91 * Method addAlignmentSequence
96 * @param vAlignmentSequence
98 public void addAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
99 throws java.lang.IndexOutOfBoundsException
101 _alignmentSequenceList.insertElementAt(vAlignmentSequence, index);
102 } //-- void addAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
111 public void addTree(org.vamsas.objects.core.Tree vTree)
112 throws java.lang.IndexOutOfBoundsException
114 _treeList.addElement(vTree);
115 } //-- void addTree(org.vamsas.objects.core.Tree)
125 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
126 throws java.lang.IndexOutOfBoundsException
128 _treeList.insertElementAt(vTree, index);
129 } //-- void addTree(int, org.vamsas.objects.core.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.objects.core.AlignmentAnnotations getAlignmentAnnotations()
213 return this._alignmentAnnotations;
214 } //-- org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
217 * Method getAlignmentSequence
222 * @return AlignmentSequence
224 public org.vamsas.objects.core.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.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
233 } //-- org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int)
236 * Method getAlignmentSequence
240 * @return AlignmentSequence
242 public org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
244 int size = _alignmentSequenceList.size();
245 org.vamsas.objects.core.AlignmentSequence[] mArray = new org.vamsas.objects.core.AlignmentSequence[size];
246 for (int index = 0; index < size; index++) {
247 mArray[index] = (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
250 } //-- org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
253 * Method getAlignmentSequenceCount
259 public int getAlignmentSequenceCount()
261 return _alignmentSequenceList.size();
262 } //-- int getAlignmentSequenceCount()
265 * Returns the value of field 'provenance'.
268 * @return the value of field 'provenance'.
270 public org.vamsas.objects.core.Provenance getProvenance()
272 return this._provenance;
273 } //-- org.vamsas.objects.core.Provenance getProvenance()
283 public org.vamsas.objects.core.Tree getTree(int index)
284 throws java.lang.IndexOutOfBoundsException
286 //-- check bounds for index
287 if ((index < 0) || (index > _treeList.size())) {
288 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
291 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
292 } //-- org.vamsas.objects.core.Tree getTree(int)
301 public org.vamsas.objects.core.Tree[] getTree()
303 int size = _treeList.size();
304 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
305 for (int index = 0; index < size; index++) {
306 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
309 } //-- org.vamsas.objects.core.Tree[] getTree()
312 * Method getTreeCount
318 public int getTreeCount()
320 return _treeList.size();
321 } //-- int getTreeCount()
330 public boolean isValid()
335 catch (org.exolab.castor.xml.ValidationException vex) {
339 } //-- boolean isValid()
348 public void marshal(java.io.Writer out)
349 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
352 Marshaller.marshal(this, out);
353 } //-- void marshal(java.io.Writer)
362 public void marshal(org.xml.sax.ContentHandler handler)
363 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
366 Marshaller.marshal(this, handler);
367 } //-- void marshal(org.xml.sax.ContentHandler)
370 * Method removeAlignmentSequence
375 * @return AlignmentSequence
377 public org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int index)
379 java.lang.Object obj = _alignmentSequenceList.elementAt(index);
380 _alignmentSequenceList.removeElementAt(index);
381 return (org.vamsas.objects.core.AlignmentSequence) obj;
382 } //-- org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int)
385 * Method removeAllAlignmentSequence
388 public void removeAllAlignmentSequence()
390 _alignmentSequenceList.removeAllElements();
391 } //-- void removeAllAlignmentSequence()
394 * Method removeAllTree
397 public void removeAllTree()
399 _treeList.removeAllElements();
400 } //-- void removeAllTree()
410 public org.vamsas.objects.core.Tree removeTree(int index)
412 java.lang.Object obj = _treeList.elementAt(index);
413 _treeList.removeElementAt(index);
414 return (org.vamsas.objects.core.Tree) obj;
415 } //-- org.vamsas.objects.core.Tree removeTree(int)
418 * Sets the value of field 'alignmentAnnotations'.
420 * @param alignmentAnnotations the value of field
421 * 'alignmentAnnotations'.
423 public void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations alignmentAnnotations)
425 this._alignmentAnnotations = alignmentAnnotations;
426 } //-- void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations)
429 * Method setAlignmentSequence
434 * @param vAlignmentSequence
436 public void setAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
437 throws java.lang.IndexOutOfBoundsException
439 //-- check bounds for index
440 if ((index < 0) || (index > _alignmentSequenceList.size())) {
441 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
443 _alignmentSequenceList.setElementAt(vAlignmentSequence, index);
444 } //-- void setAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
447 * Method setAlignmentSequence
451 * @param alignmentSequenceArray
453 public void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence[] alignmentSequenceArray)
456 _alignmentSequenceList.removeAllElements();
457 for (int i = 0; i < alignmentSequenceArray.length; i++) {
458 _alignmentSequenceList.addElement(alignmentSequenceArray[i]);
460 } //-- void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
463 * Sets the value of field 'provenance'.
465 * @param provenance the value of field 'provenance'.
467 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
469 this._provenance = provenance;
470 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
480 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
481 throws java.lang.IndexOutOfBoundsException
483 //-- check bounds for index
484 if ((index < 0) || (index > _treeList.size())) {
485 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
487 _treeList.setElementAt(vTree, index);
488 } //-- void setTree(int, org.vamsas.objects.core.Tree)
497 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
500 _treeList.removeAllElements();
501 for (int i = 0; i < treeArray.length; i++) {
502 _treeList.addElement(treeArray[i]);
504 } //-- void setTree(org.vamsas.objects.core.Tree)
514 public static org.vamsas.objects.core.Alignment unmarshal(java.io.Reader reader)
515 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
517 return (org.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(org.vamsas.objects.core.Alignment.class, reader);
518 } //-- org.vamsas.objects.core.Alignment unmarshal(java.io.Reader)
524 public void validate()
525 throws org.exolab.castor.xml.ValidationException
527 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
528 validator.validate(this);
529 } //-- void validate()