2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package uk.ac.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Alignment extends uk.ac.vamsas.client.Vobject
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
34 private java.lang.String _gapChar;
39 private boolean _aligned;
42 * keeps track of state for field: _aligned
44 private boolean _has_aligned;
47 * Primary Key for vamsas object referencing
50 private java.lang.String _id;
55 private java.lang.String _modifiable;
58 * This is annotation over the coordinate frame
59 * defined by all the columns in the alignment.
62 private java.util.Vector _alignmentAnnotationList;
67 private java.util.Vector _treeList;
70 * Field _alignmentSequenceList.
72 private java.util.Vector _alignmentSequenceList;
75 * typical properties may be additional
76 * alignment score objects
78 private java.util.Vector _propertyList;
83 private uk.ac.vamsas.objects.core.Provenance _provenance;
92 this._alignmentAnnotationList = new java.util.Vector();
93 this._treeList = new java.util.Vector();
94 this._alignmentSequenceList = new java.util.Vector();
95 this._propertyList = new java.util.Vector();
106 * @param vAlignmentAnnotation
107 * @throws java.lang.IndexOutOfBoundsException if the index
108 * given is outside the bounds of the collection
110 public void addAlignmentAnnotation(
111 final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
112 throws java.lang.IndexOutOfBoundsException {
113 this._alignmentAnnotationList.addElement(vAlignmentAnnotation);
120 * @param vAlignmentAnnotation
121 * @throws java.lang.IndexOutOfBoundsException if the index
122 * given is outside the bounds of the collection
124 public void addAlignmentAnnotation(
126 final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
127 throws java.lang.IndexOutOfBoundsException {
128 this._alignmentAnnotationList.add(index, vAlignmentAnnotation);
134 * @param vAlignmentSequence
135 * @throws java.lang.IndexOutOfBoundsException if the index
136 * given is outside the bounds of the collection
138 public void addAlignmentSequence(
139 final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
140 throws java.lang.IndexOutOfBoundsException {
141 this._alignmentSequenceList.addElement(vAlignmentSequence);
148 * @param vAlignmentSequence
149 * @throws java.lang.IndexOutOfBoundsException if the index
150 * given is outside the bounds of the collection
152 public void addAlignmentSequence(
154 final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
155 throws java.lang.IndexOutOfBoundsException {
156 this._alignmentSequenceList.add(index, vAlignmentSequence);
163 * @throws java.lang.IndexOutOfBoundsException if the index
164 * given is outside the bounds of the collection
166 public void addProperty(
167 final uk.ac.vamsas.objects.core.Property vProperty)
168 throws java.lang.IndexOutOfBoundsException {
169 this._propertyList.addElement(vProperty);
177 * @throws java.lang.IndexOutOfBoundsException if the index
178 * given is outside the bounds of the collection
180 public void addProperty(
182 final uk.ac.vamsas.objects.core.Property vProperty)
183 throws java.lang.IndexOutOfBoundsException {
184 this._propertyList.add(index, vProperty);
191 * @throws java.lang.IndexOutOfBoundsException if the index
192 * given is outside the bounds of the collection
195 final uk.ac.vamsas.objects.core.Tree vTree)
196 throws java.lang.IndexOutOfBoundsException {
197 this._treeList.addElement(vTree);
205 * @throws java.lang.IndexOutOfBoundsException if the index
206 * given is outside the bounds of the collection
210 final uk.ac.vamsas.objects.core.Tree vTree)
211 throws java.lang.IndexOutOfBoundsException {
212 this._treeList.add(index, vTree);
217 public void deleteAligned(
219 this._has_aligned= false;
223 * Method enumerateAlignmentAnnotation.
225 * @return an Enumeration over all
226 * uk.ac.vamsas.objects.core.AlignmentAnnotation elements
228 public java.util.Enumeration enumerateAlignmentAnnotation(
230 return this._alignmentAnnotationList.elements();
234 * Method enumerateAlignmentSequence.
236 * @return an Enumeration over all
237 * uk.ac.vamsas.objects.core.AlignmentSequence elements
239 public java.util.Enumeration enumerateAlignmentSequence(
241 return this._alignmentSequenceList.elements();
245 * Method enumerateProperty.
247 * @return an Enumeration over all
248 * uk.ac.vamsas.objects.core.Property elements
250 public java.util.Enumeration enumerateProperty(
252 return this._propertyList.elements();
256 * Method enumerateTree.
258 * @return an Enumeration over all
259 * uk.ac.vamsas.objects.core.Tree elements
261 public java.util.Enumeration enumerateTree(
263 return this._treeList.elements();
267 * Overrides the java.lang.Object.equals method.
270 * @return true if the objects are equal.
272 public boolean equals(
273 final java.lang.Object obj) {
277 if (super.equals(obj)==false)
280 if (obj instanceof Alignment) {
282 Alignment temp = (Alignment)obj;
285 if (this._gapChar != null) {
286 if (temp._gapChar == null) return false;
287 if (this._gapChar != temp._gapChar) {
288 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._gapChar);
289 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._gapChar);
290 if (thcycle!=tmcycle) {
291 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar); };
292 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar); };
296 if (!this._gapChar.equals(temp._gapChar)) {
297 org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
298 org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
301 org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
302 org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
305 } else if (temp._gapChar != null)
307 if (this._aligned != temp._aligned)
309 if (this._has_aligned != temp._has_aligned)
311 if (this._id != null) {
312 if (temp._id == null) return false;
313 if (this._id != temp._id) {
314 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
315 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
316 if (thcycle!=tmcycle) {
317 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
318 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
322 if (!this._id.equals(temp._id)) {
323 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
324 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
327 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
328 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
331 } else if (temp._id != null)
333 if (this._modifiable != null) {
334 if (temp._modifiable == null) return false;
335 if (this._modifiable != temp._modifiable) {
336 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
337 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
338 if (thcycle!=tmcycle) {
339 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
340 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
344 if (!this._modifiable.equals(temp._modifiable)) {
345 org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
346 org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
349 org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
350 org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
353 } else if (temp._modifiable != null)
355 if (this._alignmentAnnotationList != null) {
356 if (temp._alignmentAnnotationList == null) return false;
357 if (this._alignmentAnnotationList != temp._alignmentAnnotationList) {
358 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentAnnotationList);
359 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentAnnotationList);
360 if (thcycle!=tmcycle) {
361 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList); };
362 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList); };
366 if (!this._alignmentAnnotationList.equals(temp._alignmentAnnotationList)) {
367 org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList);
368 org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList);
371 org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList);
372 org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList);
375 } else if (temp._alignmentAnnotationList != null)
377 if (this._treeList != null) {
378 if (temp._treeList == null) return false;
379 if (this._treeList != temp._treeList) {
380 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
381 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
382 if (thcycle!=tmcycle) {
383 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
384 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
388 if (!this._treeList.equals(temp._treeList)) {
389 org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
390 org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
393 org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
394 org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
397 } else if (temp._treeList != null)
399 if (this._alignmentSequenceList != null) {
400 if (temp._alignmentSequenceList == null) return false;
401 if (this._alignmentSequenceList != temp._alignmentSequenceList) {
402 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentSequenceList);
403 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentSequenceList);
404 if (thcycle!=tmcycle) {
405 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList); };
406 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList); };
410 if (!this._alignmentSequenceList.equals(temp._alignmentSequenceList)) {
411 org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList);
412 org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList);
415 org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList);
416 org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList);
419 } else if (temp._alignmentSequenceList != null)
421 if (this._propertyList != null) {
422 if (temp._propertyList == null) return false;
423 if (this._propertyList != temp._propertyList) {
424 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
425 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
426 if (thcycle!=tmcycle) {
427 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
428 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
432 if (!this._propertyList.equals(temp._propertyList)) {
433 org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
434 org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
437 org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
438 org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
441 } else if (temp._propertyList != null)
443 if (this._provenance != null) {
444 if (temp._provenance == null) return false;
445 if (this._provenance != temp._provenance) {
446 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
447 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
448 if (thcycle!=tmcycle) {
449 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
450 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
454 if (!this._provenance.equals(temp._provenance)) {
455 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
456 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
459 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
460 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
463 } else if (temp._provenance != null)
471 * Returns the value of field 'aligned'.
473 * @return the value of field 'Aligned'.
475 public boolean getAligned(
477 return this._aligned;
481 * Method getAlignmentAnnotation.
484 * @throws java.lang.IndexOutOfBoundsException if the index
485 * given is outside the bounds of the collection
486 * @return the value of the
487 * uk.ac.vamsas.objects.core.AlignmentAnnotation at the given
490 public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(
492 throws java.lang.IndexOutOfBoundsException {
493 // check bounds for index
494 if (index < 0 || index >= this._alignmentAnnotationList.size()) {
495 throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
498 return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.get(index);
502 * Method getAlignmentAnnotation.Returns the contents of the
503 * collection in an Array. <p>Note: Just in case the
504 * collection contents are changing in another thread, we pass
505 * a 0-length Array of the correct type into the API call.
506 * This way we <i>know</i> that the Array returned is of
507 * exactly the correct length.
509 * @return this collection as an Array
511 public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation(
513 uk.ac.vamsas.objects.core.AlignmentAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentAnnotation[0];
514 return (uk.ac.vamsas.objects.core.AlignmentAnnotation[]) this._alignmentAnnotationList.toArray(array);
518 * Method getAlignmentAnnotationAsReference.Returns a reference
519 * to '_alignmentAnnotationList'. No type checking is performed
520 * on any modifications to the Vector.
522 * @return a reference to the Vector backing this class
524 public java.util.Vector getAlignmentAnnotationAsReference(
526 return this._alignmentAnnotationList;
530 * Method getAlignmentAnnotationCount.
532 * @return the size of this collection
534 public int getAlignmentAnnotationCount(
536 return this._alignmentAnnotationList.size();
540 * Method getAlignmentSequence.
543 * @throws java.lang.IndexOutOfBoundsException if the index
544 * given is outside the bounds of the collection
545 * @return the value of the
546 * uk.ac.vamsas.objects.core.AlignmentSequence at the given inde
548 public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(
550 throws java.lang.IndexOutOfBoundsException {
551 // check bounds for index
552 if (index < 0 || index >= this._alignmentSequenceList.size()) {
553 throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
556 return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.get(index);
560 * Method getAlignmentSequence.Returns the contents of the
561 * collection in an Array. <p>Note: Just in case the
562 * collection contents are changing in another thread, we pass
563 * a 0-length Array of the correct type into the API call.
564 * This way we <i>know</i> that the Array returned is of
565 * exactly the correct length.
567 * @return this collection as an Array
569 public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence(
571 uk.ac.vamsas.objects.core.AlignmentSequence[] array = new uk.ac.vamsas.objects.core.AlignmentSequence[0];
572 return (uk.ac.vamsas.objects.core.AlignmentSequence[]) this._alignmentSequenceList.toArray(array);
576 * Method getAlignmentSequenceAsReference.Returns a reference
577 * to '_alignmentSequenceList'. No type checking is performed
578 * on any modifications to the Vector.
580 * @return a reference to the Vector backing this class
582 public java.util.Vector getAlignmentSequenceAsReference(
584 return this._alignmentSequenceList;
588 * Method getAlignmentSequenceCount.
590 * @return the size of this collection
592 public int getAlignmentSequenceCount(
594 return this._alignmentSequenceList.size();
598 * Returns the value of field 'gapChar'.
600 * @return the value of field 'GapChar'.
602 public java.lang.String getGapChar(
604 return this._gapChar;
608 * Returns the value of field 'id'. The field 'id' has the
609 * following description: Primary Key for vamsas object
613 * @return the value of field 'Id'.
615 public java.lang.String getId(
621 * Returns the value of field 'modifiable'.
623 * @return the value of field 'Modifiable'.
625 public java.lang.String getModifiable(
627 return this._modifiable;
631 * Method getProperty.
634 * @throws java.lang.IndexOutOfBoundsException if the index
635 * given is outside the bounds of the collection
636 * @return the value of the uk.ac.vamsas.objects.core.Property
639 public uk.ac.vamsas.objects.core.Property getProperty(
641 throws java.lang.IndexOutOfBoundsException {
642 // check bounds for index
643 if (index < 0 || index >= this._propertyList.size()) {
644 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
647 return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
651 * Method getProperty.Returns the contents of the collection in
652 * an Array. <p>Note: Just in case the collection contents
653 * are changing in another thread, we pass a 0-length Array of
654 * the correct type into the API call. This way we <i>know</i>
655 * that the Array returned is of exactly the correct length.
657 * @return this collection as an Array
659 public uk.ac.vamsas.objects.core.Property[] getProperty(
661 uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
662 return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
666 * Method getPropertyAsReference.Returns a reference to
667 * '_propertyList'. No type checking is performed on any
668 * modifications to the Vector.
670 * @return a reference to the Vector backing this class
672 public java.util.Vector getPropertyAsReference(
674 return this._propertyList;
678 * Method getPropertyCount.
680 * @return the size of this collection
682 public int getPropertyCount(
684 return this._propertyList.size();
688 * Returns the value of field 'provenance'.
690 * @return the value of field 'Provenance'.
692 public uk.ac.vamsas.objects.core.Provenance getProvenance(
694 return this._provenance;
701 * @throws java.lang.IndexOutOfBoundsException if the index
702 * given is outside the bounds of the collection
703 * @return the value of the uk.ac.vamsas.objects.core.Tree at
706 public uk.ac.vamsas.objects.core.Tree getTree(
708 throws java.lang.IndexOutOfBoundsException {
709 // check bounds for index
710 if (index < 0 || index >= this._treeList.size()) {
711 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
714 return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
718 * Method getTree.Returns the contents of the collection in an
719 * Array. <p>Note: Just in case the collection contents are
720 * changing in another thread, we pass a 0-length Array of the
721 * correct type into the API call. This way we <i>know</i>
722 * that the Array returned is of exactly the correct length.
724 * @return this collection as an Array
726 public uk.ac.vamsas.objects.core.Tree[] getTree(
728 uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
729 return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
733 * Method getTreeAsReference.Returns a reference to
734 * '_treeList'. No type checking is performed on any
735 * modifications to the Vector.
737 * @return a reference to the Vector backing this class
739 public java.util.Vector getTreeAsReference(
741 return this._treeList;
745 * Method getTreeCount.
747 * @return the size of this collection
749 public int getTreeCount(
751 return this._treeList.size();
757 * @return true if at least one Aligned has been added
759 public boolean hasAligned(
761 return this._has_aligned;
765 * Overrides the java.lang.Object.hashCode method.
767 * The following steps came from <b>Effective Java Programming
768 * Language Guide</b> by Joshua Bloch, Chapter 3
770 * @return a hash code value for the object.
774 int result = super.hashCode();
778 && !org.castor.util.CycleBreaker.startingToCycle(_gapChar)) {
779 result = 37 * result + _gapChar.hashCode();
780 org.castor.util.CycleBreaker.releaseCycleHandle(_gapChar);
782 result = 37 * result + (_aligned?0:1);
784 && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
785 result = 37 * result + _id.hashCode();
786 org.castor.util.CycleBreaker.releaseCycleHandle(_id);
788 if (_modifiable != null
789 && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
790 result = 37 * result + _modifiable.hashCode();
791 org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
793 if (_alignmentAnnotationList != null
794 && !org.castor.util.CycleBreaker.startingToCycle(_alignmentAnnotationList)) {
795 result = 37 * result + _alignmentAnnotationList.hashCode();
796 org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentAnnotationList);
798 if (_treeList != null
799 && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
800 result = 37 * result + _treeList.hashCode();
801 org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
803 if (_alignmentSequenceList != null
804 && !org.castor.util.CycleBreaker.startingToCycle(_alignmentSequenceList)) {
805 result = 37 * result + _alignmentSequenceList.hashCode();
806 org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceList);
808 if (_propertyList != null
809 && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
810 result = 37 * result + _propertyList.hashCode();
811 org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
813 if (_provenance != null
814 && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
815 result = 37 * result + _provenance.hashCode();
816 org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
823 * Returns the value of field 'aligned'.
825 * @return the value of field 'Aligned'.
827 public boolean isAligned(
829 return this._aligned;
835 * @return true if this object is valid according to the schema
837 public boolean isValid(
841 } catch (org.exolab.castor.xml.ValidationException vex) {
851 * @throws org.exolab.castor.xml.MarshalException if object is
852 * null or if any SAXException is thrown during marshaling
853 * @throws org.exolab.castor.xml.ValidationException if this
854 * object is an invalid instance according to the schema
857 final java.io.Writer out)
858 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
859 Marshaller.marshal(this, out);
866 * @throws java.io.IOException if an IOException occurs during
868 * @throws org.exolab.castor.xml.ValidationException if this
869 * object is an invalid instance according to the schema
870 * @throws org.exolab.castor.xml.MarshalException if object is
871 * null or if any SAXException is thrown during marshaling
874 final org.xml.sax.ContentHandler handler)
875 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
876 Marshaller.marshal(this, handler);
880 * Method removeAlignmentAnnotation.
882 * @param vAlignmentAnnotation
883 * @return true if the object was removed from the collection.
885 public boolean removeAlignmentAnnotation(
886 final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) {
887 boolean removed = _alignmentAnnotationList.remove(vAlignmentAnnotation);
892 * Method removeAlignmentAnnotationAt.
895 * @return the element removed from the collection
897 public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotationAt(
899 java.lang.Object obj = this._alignmentAnnotationList.remove(index);
900 return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj;
904 * Method removeAlignmentSequence.
906 * @param vAlignmentSequence
907 * @return true if the object was removed from the collection.
909 public boolean removeAlignmentSequence(
910 final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) {
911 boolean removed = _alignmentSequenceList.remove(vAlignmentSequence);
916 * Method removeAlignmentSequenceAt.
919 * @return the element removed from the collection
921 public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequenceAt(
923 java.lang.Object obj = this._alignmentSequenceList.remove(index);
924 return (uk.ac.vamsas.objects.core.AlignmentSequence) obj;
929 public void removeAllAlignmentAnnotation(
931 this._alignmentAnnotationList.clear();
936 public void removeAllAlignmentSequence(
938 this._alignmentSequenceList.clear();
943 public void removeAllProperty(
945 this._propertyList.clear();
950 public void removeAllTree(
952 this._treeList.clear();
956 * Method removeProperty.
959 * @return true if the object was removed from the collection.
961 public boolean removeProperty(
962 final uk.ac.vamsas.objects.core.Property vProperty) {
963 boolean removed = _propertyList.remove(vProperty);
968 * Method removePropertyAt.
971 * @return the element removed from the collection
973 public uk.ac.vamsas.objects.core.Property removePropertyAt(
975 java.lang.Object obj = this._propertyList.remove(index);
976 return (uk.ac.vamsas.objects.core.Property) obj;
983 * @return true if the object was removed from the collection.
985 public boolean removeTree(
986 final uk.ac.vamsas.objects.core.Tree vTree) {
987 boolean removed = _treeList.remove(vTree);
992 * Method removeTreeAt.
995 * @return the element removed from the collection
997 public uk.ac.vamsas.objects.core.Tree removeTreeAt(
999 java.lang.Object obj = this._treeList.remove(index);
1000 return (uk.ac.vamsas.objects.core.Tree) obj;
1004 * Sets the value of field 'aligned'.
1006 * @param aligned the value of field 'aligned'.
1008 public void setAligned(
1009 final boolean aligned) {
1010 this._aligned = aligned;
1011 this._has_aligned = true;
1018 * @param vAlignmentAnnotation
1019 * @throws java.lang.IndexOutOfBoundsException if the index
1020 * given is outside the bounds of the collection
1022 public void setAlignmentAnnotation(
1024 final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
1025 throws java.lang.IndexOutOfBoundsException {
1026 // check bounds for index
1027 if (index < 0 || index >= this._alignmentAnnotationList.size()) {
1028 throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
1031 this._alignmentAnnotationList.set(index, vAlignmentAnnotation);
1037 * @param vAlignmentAnnotationArray
1039 public void setAlignmentAnnotation(
1040 final uk.ac.vamsas.objects.core.AlignmentAnnotation[] vAlignmentAnnotationArray) {
1042 _alignmentAnnotationList.clear();
1044 for (int i = 0; i < vAlignmentAnnotationArray.length; i++) {
1045 this._alignmentAnnotationList.add(vAlignmentAnnotationArray[i]);
1050 * Sets the value of '_alignmentAnnotationList' by copying the
1051 * given Vector. All elements will be checked for type safety.
1053 * @param vAlignmentAnnotationList the Vector to copy.
1055 public void setAlignmentAnnotation(
1056 final java.util.Vector vAlignmentAnnotationList) {
1058 this._alignmentAnnotationList.clear();
1060 this._alignmentAnnotationList.addAll(vAlignmentAnnotationList);
1064 * Sets the value of '_alignmentAnnotationList' by setting it
1065 * to the given Vector. No type checking is performed.
1068 * @param alignmentAnnotationVector the Vector to set.
1070 public void setAlignmentAnnotationAsReference(
1071 final java.util.Vector alignmentAnnotationVector) {
1072 this._alignmentAnnotationList = alignmentAnnotationVector;
1079 * @param vAlignmentSequence
1080 * @throws java.lang.IndexOutOfBoundsException if the index
1081 * given is outside the bounds of the collection
1083 public void setAlignmentSequence(
1085 final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
1086 throws java.lang.IndexOutOfBoundsException {
1087 // check bounds for index
1088 if (index < 0 || index >= this._alignmentSequenceList.size()) {
1089 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
1092 this._alignmentSequenceList.set(index, vAlignmentSequence);
1098 * @param vAlignmentSequenceArray
1100 public void setAlignmentSequence(
1101 final uk.ac.vamsas.objects.core.AlignmentSequence[] vAlignmentSequenceArray) {
1103 _alignmentSequenceList.clear();
1105 for (int i = 0; i < vAlignmentSequenceArray.length; i++) {
1106 this._alignmentSequenceList.add(vAlignmentSequenceArray[i]);
1111 * Sets the value of '_alignmentSequenceList' by copying the
1112 * given Vector. All elements will be checked for type safety.
1114 * @param vAlignmentSequenceList the Vector to copy.
1116 public void setAlignmentSequence(
1117 final java.util.Vector vAlignmentSequenceList) {
1119 this._alignmentSequenceList.clear();
1121 this._alignmentSequenceList.addAll(vAlignmentSequenceList);
1125 * Sets the value of '_alignmentSequenceList' by setting it to
1126 * the given Vector. No type checking is performed.
1129 * @param alignmentSequenceVector the Vector to set.
1131 public void setAlignmentSequenceAsReference(
1132 final java.util.Vector alignmentSequenceVector) {
1133 this._alignmentSequenceList = alignmentSequenceVector;
1137 * Sets the value of field 'gapChar'.
1139 * @param gapChar the value of field 'gapChar'.
1141 public void setGapChar(
1142 final java.lang.String gapChar) {
1143 this._gapChar = gapChar;
1147 * Sets the value of field 'id'. The field 'id' has the
1148 * following description: Primary Key for vamsas object
1152 * @param id the value of field 'id'.
1155 final java.lang.String id) {
1160 * Sets the value of field 'modifiable'.
1162 * @param modifiable the value of field 'modifiable'.
1164 public void setModifiable(
1165 final java.lang.String modifiable) {
1166 this._modifiable = modifiable;
1174 * @throws java.lang.IndexOutOfBoundsException if the index
1175 * given is outside the bounds of the collection
1177 public void setProperty(
1179 final uk.ac.vamsas.objects.core.Property vProperty)
1180 throws java.lang.IndexOutOfBoundsException {
1181 // check bounds for index
1182 if (index < 0 || index >= this._propertyList.size()) {
1183 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
1186 this._propertyList.set(index, vProperty);
1192 * @param vPropertyArray
1194 public void setProperty(
1195 final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
1197 _propertyList.clear();
1199 for (int i = 0; i < vPropertyArray.length; i++) {
1200 this._propertyList.add(vPropertyArray[i]);
1205 * Sets the value of '_propertyList' by copying the given
1206 * Vector. All elements will be checked for type safety.
1208 * @param vPropertyList the Vector to copy.
1210 public void setProperty(
1211 final java.util.Vector vPropertyList) {
1213 this._propertyList.clear();
1215 this._propertyList.addAll(vPropertyList);
1219 * Sets the value of '_propertyList' by setting it to the given
1220 * Vector. No type checking is performed.
1223 * @param propertyVector the Vector to set.
1225 public void setPropertyAsReference(
1226 final java.util.Vector propertyVector) {
1227 this._propertyList = propertyVector;
1231 * Sets the value of field 'provenance'.
1233 * @param provenance the value of field 'provenance'.
1235 public void setProvenance(
1236 final uk.ac.vamsas.objects.core.Provenance provenance) {
1237 this._provenance = provenance;
1245 * @throws java.lang.IndexOutOfBoundsException if the index
1246 * given is outside the bounds of the collection
1248 public void setTree(
1250 final uk.ac.vamsas.objects.core.Tree vTree)
1251 throws java.lang.IndexOutOfBoundsException {
1252 // check bounds for index
1253 if (index < 0 || index >= this._treeList.size()) {
1254 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
1257 this._treeList.set(index, vTree);
1265 public void setTree(
1266 final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
1270 for (int i = 0; i < vTreeArray.length; i++) {
1271 this._treeList.add(vTreeArray[i]);
1276 * Sets the value of '_treeList' by copying the given Vector.
1277 * All elements will be checked for type safety.
1279 * @param vTreeList the Vector to copy.
1281 public void setTree(
1282 final java.util.Vector vTreeList) {
1284 this._treeList.clear();
1286 this._treeList.addAll(vTreeList);
1290 * Sets the value of '_treeList' by setting it to the given
1291 * Vector. No type checking is performed.
1294 * @param treeVector the Vector to set.
1296 public void setTreeAsReference(
1297 final java.util.Vector treeVector) {
1298 this._treeList = treeVector;
1305 * @throws org.exolab.castor.xml.MarshalException if object is
1306 * null or if any SAXException is thrown during marshaling
1307 * @throws org.exolab.castor.xml.ValidationException if this
1308 * object is an invalid instance according to the schema
1309 * @return the unmarshaled uk.ac.vamsas.objects.core.Alignment
1311 public static uk.ac.vamsas.objects.core.Alignment unmarshal(
1312 final java.io.Reader reader)
1313 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1314 return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Alignment.class, reader);
1320 * @throws org.exolab.castor.xml.ValidationException if this
1321 * object is an invalid instance according to the schema
1323 public void validate(
1325 throws org.exolab.castor.xml.ValidationException {
1326 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1327 validator.validate(this);