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 _alignmentAnnotations
63 private org.vamsas.objects.core.AlignmentAnnotations _alignmentAnnotations;
68 private java.util.Vector _treeList;
71 * Field _alignmentSequenceList
73 private java.util.Vector _alignmentSequenceList;
78 private org.vamsas.objects.core.Provenance _provenance;
88 _treeList = new Vector();
89 _alignmentSequenceList = new Vector();
90 } //-- org.vamsas.objects.core.Alignment()
98 * Method addAlignmentSequence
102 * @param vAlignmentSequence
104 public void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
105 throws java.lang.IndexOutOfBoundsException
107 _alignmentSequenceList.addElement(vAlignmentSequence);
108 } //-- void addAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
111 * Method addAlignmentSequence
116 * @param vAlignmentSequence
118 public void addAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
119 throws java.lang.IndexOutOfBoundsException
121 _alignmentSequenceList.insertElementAt(vAlignmentSequence, index);
122 } //-- void addAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
131 public void addTree(org.vamsas.objects.core.Tree vTree)
132 throws java.lang.IndexOutOfBoundsException
134 _treeList.addElement(vTree);
135 } //-- void addTree(org.vamsas.objects.core.Tree)
145 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
146 throws java.lang.IndexOutOfBoundsException
148 _treeList.insertElementAt(vTree, index);
149 } //-- void addTree(int, org.vamsas.objects.core.Tree)
152 * Method deleteAligned
155 public void deleteAligned()
157 this._has_aligned= false;
158 } //-- void deleteAligned()
161 * Method enumerateAlignmentSequence
165 * @return Enumeration
167 public java.util.Enumeration enumerateAlignmentSequence()
169 return _alignmentSequenceList.elements();
170 } //-- java.util.Enumeration enumerateAlignmentSequence()
173 * Method enumerateTree
177 * @return Enumeration
179 public java.util.Enumeration enumerateTree()
181 return _treeList.elements();
182 } //-- java.util.Enumeration enumerateTree()
185 * Note: hashCode() has not been overriden
190 public boolean equals(java.lang.Object obj)
195 if (super.equals(obj)==false)
198 if (obj instanceof Alignment) {
200 Alignment temp = (Alignment)obj;
201 if (this._gapChar != null) {
202 if (temp._gapChar == null) return false;
203 else if (!(this._gapChar.equals(temp._gapChar)))
206 else if (temp._gapChar != null)
208 if (this._aligned != temp._aligned)
210 if (this._has_aligned != temp._has_aligned)
212 if (this._id != null) {
213 if (temp._id == null) return false;
214 else if (!(this._id.equals(temp._id)))
217 else if (temp._id != null)
219 if (this._alignmentAnnotations != null) {
220 if (temp._alignmentAnnotations == null) return false;
221 else if (!(this._alignmentAnnotations.equals(temp._alignmentAnnotations)))
224 else if (temp._alignmentAnnotations != null)
226 if (this._treeList != null) {
227 if (temp._treeList == null) return false;
228 else if (!(this._treeList.equals(temp._treeList)))
231 else if (temp._treeList != null)
233 if (this._alignmentSequenceList != null) {
234 if (temp._alignmentSequenceList == null) return false;
235 else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList)))
238 else if (temp._alignmentSequenceList != null)
240 if (this._provenance != null) {
241 if (temp._provenance == null) return false;
242 else if (!(this._provenance.equals(temp._provenance)))
245 else if (temp._provenance != null)
250 } //-- boolean equals(java.lang.Object)
253 * Returns the value of field 'aligned'.
256 * @return the value of field 'aligned'.
258 public boolean getAligned()
260 return this._aligned;
261 } //-- boolean getAligned()
264 * Returns the value of field 'alignmentAnnotations'.
266 * @return AlignmentAnnotations
267 * @return the value of field 'alignmentAnnotations'.
269 public org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
271 return this._alignmentAnnotations;
272 } //-- org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
275 * Method getAlignmentSequence
280 * @return AlignmentSequence
282 public org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int index)
283 throws java.lang.IndexOutOfBoundsException
285 //-- check bounds for index
286 if ((index < 0) || (index > _alignmentSequenceList.size())) {
287 throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
290 return (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
291 } //-- org.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int)
294 * Method getAlignmentSequence
298 * @return AlignmentSequence
300 public org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
302 int size = _alignmentSequenceList.size();
303 org.vamsas.objects.core.AlignmentSequence[] mArray = new org.vamsas.objects.core.AlignmentSequence[size];
304 for (int index = 0; index < size; index++) {
305 mArray[index] = (org.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index);
308 } //-- org.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence()
311 * Method getAlignmentSequenceCount
317 public int getAlignmentSequenceCount()
319 return _alignmentSequenceList.size();
320 } //-- int getAlignmentSequenceCount()
323 * Returns the value of field 'gapChar'.
326 * @return the value of field 'gapChar'.
328 public java.lang.String getGapChar()
330 return this._gapChar;
331 } //-- java.lang.String getGapChar()
334 * Returns the value of field 'id'.
337 * @return the value of field 'id'.
339 public java.lang.String getId()
342 } //-- java.lang.String getId()
345 * Returns the value of field 'provenance'.
348 * @return the value of field 'provenance'.
350 public org.vamsas.objects.core.Provenance getProvenance()
352 return this._provenance;
353 } //-- org.vamsas.objects.core.Provenance getProvenance()
363 public org.vamsas.objects.core.Tree getTree(int index)
364 throws java.lang.IndexOutOfBoundsException
366 //-- check bounds for index
367 if ((index < 0) || (index > _treeList.size())) {
368 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
371 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
372 } //-- org.vamsas.objects.core.Tree getTree(int)
381 public org.vamsas.objects.core.Tree[] getTree()
383 int size = _treeList.size();
384 org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size];
385 for (int index = 0; index < size; index++) {
386 mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
389 } //-- org.vamsas.objects.core.Tree[] getTree()
392 * Method getTreeCount
398 public int getTreeCount()
400 return _treeList.size();
401 } //-- int getTreeCount()
410 public boolean hasAligned()
412 return this._has_aligned;
413 } //-- boolean hasAligned()
422 public boolean isValid()
427 catch (org.exolab.castor.xml.ValidationException vex) {
431 } //-- boolean isValid()
440 public void marshal(java.io.Writer out)
441 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
444 Marshaller.marshal(this, out);
445 } //-- void marshal(java.io.Writer)
454 public void marshal(org.xml.sax.ContentHandler handler)
455 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
458 Marshaller.marshal(this, handler);
459 } //-- void marshal(org.xml.sax.ContentHandler)
462 * Method removeAlignmentSequence
467 * @return AlignmentSequence
469 public org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int index)
471 java.lang.Object obj = _alignmentSequenceList.elementAt(index);
472 _alignmentSequenceList.removeElementAt(index);
473 return (org.vamsas.objects.core.AlignmentSequence) obj;
474 } //-- org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int)
477 * Method removeAllAlignmentSequence
480 public void removeAllAlignmentSequence()
482 _alignmentSequenceList.removeAllElements();
483 } //-- void removeAllAlignmentSequence()
486 * Method removeAllTree
489 public void removeAllTree()
491 _treeList.removeAllElements();
492 } //-- void removeAllTree()
502 public org.vamsas.objects.core.Tree removeTree(int index)
504 java.lang.Object obj = _treeList.elementAt(index);
505 _treeList.removeElementAt(index);
506 return (org.vamsas.objects.core.Tree) obj;
507 } //-- org.vamsas.objects.core.Tree removeTree(int)
510 * Sets the value of field 'aligned'.
512 * @param aligned the value of field 'aligned'.
514 public void setAligned(boolean aligned)
516 this._aligned = aligned;
517 this._has_aligned = true;
518 } //-- void setAligned(boolean)
521 * Sets the value of field 'alignmentAnnotations'.
523 * @param alignmentAnnotations the value of field
524 * 'alignmentAnnotations'.
526 public void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations alignmentAnnotations)
528 this._alignmentAnnotations = alignmentAnnotations;
529 } //-- void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations)
532 * Method setAlignmentSequence
537 * @param vAlignmentSequence
539 public void setAlignmentSequence(int index, org.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
540 throws java.lang.IndexOutOfBoundsException
542 //-- check bounds for index
543 if ((index < 0) || (index > _alignmentSequenceList.size())) {
544 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
546 _alignmentSequenceList.setElementAt(vAlignmentSequence, index);
547 } //-- void setAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
550 * Method setAlignmentSequence
554 * @param alignmentSequenceArray
556 public void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence[] alignmentSequenceArray)
559 _alignmentSequenceList.removeAllElements();
560 for (int i = 0; i < alignmentSequenceArray.length; i++) {
561 _alignmentSequenceList.addElement(alignmentSequenceArray[i]);
563 } //-- void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
566 * Sets the value of field 'gapChar'.
568 * @param gapChar the value of field 'gapChar'.
570 public void setGapChar(java.lang.String gapChar)
572 this._gapChar = gapChar;
573 } //-- void setGapChar(java.lang.String)
576 * Sets the value of field 'id'.
578 * @param id the value of field 'id'.
580 public void setId(java.lang.String id)
583 } //-- void setId(java.lang.String)
586 * Sets the value of field 'provenance'.
588 * @param provenance the value of field 'provenance'.
590 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
592 this._provenance = provenance;
593 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
603 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
604 throws java.lang.IndexOutOfBoundsException
606 //-- check bounds for index
607 if ((index < 0) || (index > _treeList.size())) {
608 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
610 _treeList.setElementAt(vTree, index);
611 } //-- void setTree(int, org.vamsas.objects.core.Tree)
620 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
623 _treeList.removeAllElements();
624 for (int i = 0; i < treeArray.length; i++) {
625 _treeList.addElement(treeArray[i]);
627 } //-- void setTree(org.vamsas.objects.core.Tree)
637 public static org.vamsas.objects.core.Alignment unmarshal(java.io.Reader reader)
638 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
640 return (org.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(org.vamsas.objects.core.Alignment.class, reader);
641 } //-- org.vamsas.objects.core.Alignment unmarshal(java.io.Reader)
647 public void validate()
648 throws org.exolab.castor.xml.ValidationException
650 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
651 validator.validate(this);
652 } //-- void validate()