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;
283 if (this._gapChar != null) {
284 if (temp._gapChar == null) return false;
285 else if (!(this._gapChar.equals(temp._gapChar)))
288 else if (temp._gapChar != null)
290 if (this._aligned != temp._aligned)
292 if (this._has_aligned != temp._has_aligned)
294 if (this._id != null) {
295 if (temp._id == null) return false;
296 else if (!(this._id.equals(temp._id)))
299 else if (temp._id != null)
301 if (this._modifiable != null) {
302 if (temp._modifiable == null) return false;
303 else if (!(this._modifiable.equals(temp._modifiable)))
306 else if (temp._modifiable != null)
308 if (this._alignmentAnnotationList != null) {
309 if (temp._alignmentAnnotationList == null) return false;
310 else if (!(this._alignmentAnnotationList.equals(temp._alignmentAnnotationList)))
313 else if (temp._alignmentAnnotationList != null)
315 if (this._treeList != null) {
316 if (temp._treeList == null) return false;
317 else if (!(this._treeList.equals(temp._treeList)))
320 else if (temp._treeList != null)
322 if (this._alignmentSequenceList != null) {
323 if (temp._alignmentSequenceList == null) return false;
324 else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList)))
327 else if (temp._alignmentSequenceList != null)
329 if (this._propertyList != null) {
330 if (temp._propertyList == null) return false;
331 else if (!(this._propertyList.equals(temp._propertyList)))
334 else if (temp._propertyList != null)
336 if (this._provenance != null) {
337 if (temp._provenance == null) return false;
338 else if (!(this._provenance.equals(temp._provenance)))
341 else if (temp._provenance != null)
349 * Returns the value of field 'aligned'.
351 * @return the value of field 'Aligned'.
353 public boolean getAligned(
355 return this._aligned;
359 * Method getAlignmentAnnotation.
362 * @throws java.lang.IndexOutOfBoundsException if the index
363 * given is outside the bounds of the collection
364 * @return the value of the
365 * uk.ac.vamsas.objects.core.AlignmentAnnotation at the given
368 public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(
370 throws java.lang.IndexOutOfBoundsException {
371 // check bounds for index
372 if (index < 0 || index >= this._alignmentAnnotationList.size()) {
373 throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
376 return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.get(index);
380 * Method getAlignmentAnnotation.Returns the contents of the
381 * collection in an Array. <p>Note: Just in case the
382 * collection contents are changing in another thread, we pass
383 * a 0-length Array of the correct type into the API call.
384 * This way we <i>know</i> that the Array returned is of
385 * exactly the correct length.
387 * @return this collection as an Array
389 public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation(
391 uk.ac.vamsas.objects.core.AlignmentAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentAnnotation[0];
392 return (uk.ac.vamsas.objects.core.AlignmentAnnotation[]) this._alignmentAnnotationList.toArray(array);
396 * Method getAlignmentAnnotationAsReference.Returns a reference
397 * to '_alignmentAnnotationList'. No type checking is performed
398 * on any modifications to the Vector.
400 * @return a reference to the Vector backing this class
402 public java.util.Vector getAlignmentAnnotationAsReference(
404 return this._alignmentAnnotationList;
408 * Method getAlignmentAnnotationCount.
410 * @return the size of this collection
412 public int getAlignmentAnnotationCount(
414 return this._alignmentAnnotationList.size();
418 * Method getAlignmentSequence.
421 * @throws java.lang.IndexOutOfBoundsException if the index
422 * given is outside the bounds of the collection
423 * @return the value of the
424 * uk.ac.vamsas.objects.core.AlignmentSequence at the given inde
426 public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(
428 throws java.lang.IndexOutOfBoundsException {
429 // check bounds for index
430 if (index < 0 || index >= this._alignmentSequenceList.size()) {
431 throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
434 return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.get(index);
438 * Method getAlignmentSequence.Returns the contents of the
439 * collection in an Array. <p>Note: Just in case the
440 * collection contents are changing in another thread, we pass
441 * a 0-length Array of the correct type into the API call.
442 * This way we <i>know</i> that the Array returned is of
443 * exactly the correct length.
445 * @return this collection as an Array
447 public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence(
449 uk.ac.vamsas.objects.core.AlignmentSequence[] array = new uk.ac.vamsas.objects.core.AlignmentSequence[0];
450 return (uk.ac.vamsas.objects.core.AlignmentSequence[]) this._alignmentSequenceList.toArray(array);
454 * Method getAlignmentSequenceAsReference.Returns a reference
455 * to '_alignmentSequenceList'. No type checking is performed
456 * on any modifications to the Vector.
458 * @return a reference to the Vector backing this class
460 public java.util.Vector getAlignmentSequenceAsReference(
462 return this._alignmentSequenceList;
466 * Method getAlignmentSequenceCount.
468 * @return the size of this collection
470 public int getAlignmentSequenceCount(
472 return this._alignmentSequenceList.size();
476 * Returns the value of field 'gapChar'.
478 * @return the value of field 'GapChar'.
480 public java.lang.String getGapChar(
482 return this._gapChar;
486 * Returns the value of field 'id'. The field 'id' has the
487 * following description: Primary Key for vamsas object
491 * @return the value of field 'Id'.
493 public java.lang.String getId(
499 * Returns the value of field 'modifiable'.
501 * @return the value of field 'Modifiable'.
503 public java.lang.String getModifiable(
505 return this._modifiable;
509 * Method getProperty.
512 * @throws java.lang.IndexOutOfBoundsException if the index
513 * given is outside the bounds of the collection
514 * @return the value of the uk.ac.vamsas.objects.core.Property
517 public uk.ac.vamsas.objects.core.Property getProperty(
519 throws java.lang.IndexOutOfBoundsException {
520 // check bounds for index
521 if (index < 0 || index >= this._propertyList.size()) {
522 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
525 return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
529 * Method getProperty.Returns the contents of the collection in
530 * an Array. <p>Note: Just in case the collection contents
531 * are changing in another thread, we pass a 0-length Array of
532 * the correct type into the API call. This way we <i>know</i>
533 * that the Array returned is of exactly the correct length.
535 * @return this collection as an Array
537 public uk.ac.vamsas.objects.core.Property[] getProperty(
539 uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
540 return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
544 * Method getPropertyAsReference.Returns a reference to
545 * '_propertyList'. No type checking is performed on any
546 * modifications to the Vector.
548 * @return a reference to the Vector backing this class
550 public java.util.Vector getPropertyAsReference(
552 return this._propertyList;
556 * Method getPropertyCount.
558 * @return the size of this collection
560 public int getPropertyCount(
562 return this._propertyList.size();
566 * Returns the value of field 'provenance'.
568 * @return the value of field 'Provenance'.
570 public uk.ac.vamsas.objects.core.Provenance getProvenance(
572 return this._provenance;
579 * @throws java.lang.IndexOutOfBoundsException if the index
580 * given is outside the bounds of the collection
581 * @return the value of the uk.ac.vamsas.objects.core.Tree at
584 public uk.ac.vamsas.objects.core.Tree getTree(
586 throws java.lang.IndexOutOfBoundsException {
587 // check bounds for index
588 if (index < 0 || index >= this._treeList.size()) {
589 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
592 return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
596 * Method getTree.Returns the contents of the collection in an
597 * Array. <p>Note: Just in case the collection contents are
598 * changing in another thread, we pass a 0-length Array of the
599 * correct type into the API call. This way we <i>know</i>
600 * that the Array returned is of exactly the correct length.
602 * @return this collection as an Array
604 public uk.ac.vamsas.objects.core.Tree[] getTree(
606 uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
607 return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
611 * Method getTreeAsReference.Returns a reference to
612 * '_treeList'. No type checking is performed on any
613 * modifications to the Vector.
615 * @return a reference to the Vector backing this class
617 public java.util.Vector getTreeAsReference(
619 return this._treeList;
623 * Method getTreeCount.
625 * @return the size of this collection
627 public int getTreeCount(
629 return this._treeList.size();
635 * @return true if at least one Aligned has been added
637 public boolean hasAligned(
639 return this._has_aligned;
643 * Overrides the java.lang.Object.hashCode method.
645 * The following steps came from <b>Effective Java Programming
646 * Language Guide</b> by Joshua Bloch, Chapter 3
648 * @return a hash code value for the object.
652 int result = super.hashCode();
655 if (_gapChar != null) {
656 result = 37 * result + _gapChar.hashCode();
658 result = 37 * result + (_aligned?0:1);
660 result = 37 * result + _id.hashCode();
662 if (_modifiable != null) {
663 result = 37 * result + _modifiable.hashCode();
665 if (_alignmentAnnotationList != null) {
666 result = 37 * result + _alignmentAnnotationList.hashCode();
668 if (_treeList != null) {
669 result = 37 * result + _treeList.hashCode();
671 if (_alignmentSequenceList != null) {
672 result = 37 * result + _alignmentSequenceList.hashCode();
674 if (_propertyList != null) {
675 result = 37 * result + _propertyList.hashCode();
677 if (_provenance != null) {
678 result = 37 * result + _provenance.hashCode();
685 * Returns the value of field 'aligned'.
687 * @return the value of field 'Aligned'.
689 public boolean isAligned(
691 return this._aligned;
697 * @return true if this object is valid according to the schema
699 public boolean isValid(
703 } catch (org.exolab.castor.xml.ValidationException vex) {
713 * @throws org.exolab.castor.xml.MarshalException if object is
714 * null or if any SAXException is thrown during marshaling
715 * @throws org.exolab.castor.xml.ValidationException if this
716 * object is an invalid instance according to the schema
719 final java.io.Writer out)
720 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
721 Marshaller.marshal(this, out);
728 * @throws java.io.IOException if an IOException occurs during
730 * @throws org.exolab.castor.xml.ValidationException if this
731 * object is an invalid instance according to the schema
732 * @throws org.exolab.castor.xml.MarshalException if object is
733 * null or if any SAXException is thrown during marshaling
736 final org.xml.sax.ContentHandler handler)
737 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
738 Marshaller.marshal(this, handler);
742 * Method removeAlignmentAnnotation.
744 * @param vAlignmentAnnotation
745 * @return true if the object was removed from the collection.
747 public boolean removeAlignmentAnnotation(
748 final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) {
749 boolean removed = _alignmentAnnotationList.remove(vAlignmentAnnotation);
754 * Method removeAlignmentAnnotationAt.
757 * @return the element removed from the collection
759 public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotationAt(
761 java.lang.Object obj = this._alignmentAnnotationList.remove(index);
762 return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj;
766 * Method removeAlignmentSequence.
768 * @param vAlignmentSequence
769 * @return true if the object was removed from the collection.
771 public boolean removeAlignmentSequence(
772 final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) {
773 boolean removed = _alignmentSequenceList.remove(vAlignmentSequence);
778 * Method removeAlignmentSequenceAt.
781 * @return the element removed from the collection
783 public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequenceAt(
785 java.lang.Object obj = this._alignmentSequenceList.remove(index);
786 return (uk.ac.vamsas.objects.core.AlignmentSequence) obj;
791 public void removeAllAlignmentAnnotation(
793 this._alignmentAnnotationList.clear();
798 public void removeAllAlignmentSequence(
800 this._alignmentSequenceList.clear();
805 public void removeAllProperty(
807 this._propertyList.clear();
812 public void removeAllTree(
814 this._treeList.clear();
818 * Method removeProperty.
821 * @return true if the object was removed from the collection.
823 public boolean removeProperty(
824 final uk.ac.vamsas.objects.core.Property vProperty) {
825 boolean removed = _propertyList.remove(vProperty);
830 * Method removePropertyAt.
833 * @return the element removed from the collection
835 public uk.ac.vamsas.objects.core.Property removePropertyAt(
837 java.lang.Object obj = this._propertyList.remove(index);
838 return (uk.ac.vamsas.objects.core.Property) obj;
845 * @return true if the object was removed from the collection.
847 public boolean removeTree(
848 final uk.ac.vamsas.objects.core.Tree vTree) {
849 boolean removed = _treeList.remove(vTree);
854 * Method removeTreeAt.
857 * @return the element removed from the collection
859 public uk.ac.vamsas.objects.core.Tree removeTreeAt(
861 java.lang.Object obj = this._treeList.remove(index);
862 return (uk.ac.vamsas.objects.core.Tree) obj;
866 * Sets the value of field 'aligned'.
868 * @param aligned the value of field 'aligned'.
870 public void setAligned(
871 final boolean aligned) {
872 this._aligned = aligned;
873 this._has_aligned = true;
880 * @param vAlignmentAnnotation
881 * @throws java.lang.IndexOutOfBoundsException if the index
882 * given is outside the bounds of the collection
884 public void setAlignmentAnnotation(
886 final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
887 throws java.lang.IndexOutOfBoundsException {
888 // check bounds for index
889 if (index < 0 || index >= this._alignmentAnnotationList.size()) {
890 throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
893 this._alignmentAnnotationList.set(index, vAlignmentAnnotation);
899 * @param vAlignmentAnnotationArray
901 public void setAlignmentAnnotation(
902 final uk.ac.vamsas.objects.core.AlignmentAnnotation[] vAlignmentAnnotationArray) {
904 _alignmentAnnotationList.clear();
906 for (int i = 0; i < vAlignmentAnnotationArray.length; i++) {
907 this._alignmentAnnotationList.add(vAlignmentAnnotationArray[i]);
912 * Sets the value of '_alignmentAnnotationList' by copying the
913 * given Vector. All elements will be checked for type safety.
915 * @param vAlignmentAnnotationList the Vector to copy.
917 public void setAlignmentAnnotation(
918 final java.util.Vector vAlignmentAnnotationList) {
920 this._alignmentAnnotationList.clear();
922 this._alignmentAnnotationList.addAll(vAlignmentAnnotationList);
926 * Sets the value of '_alignmentAnnotationList' by setting it
927 * to the given Vector. No type checking is performed.
930 * @param alignmentAnnotationVector the Vector to set.
932 public void setAlignmentAnnotationAsReference(
933 final java.util.Vector alignmentAnnotationVector) {
934 this._alignmentAnnotationList = alignmentAnnotationVector;
941 * @param vAlignmentSequence
942 * @throws java.lang.IndexOutOfBoundsException if the index
943 * given is outside the bounds of the collection
945 public void setAlignmentSequence(
947 final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
948 throws java.lang.IndexOutOfBoundsException {
949 // check bounds for index
950 if (index < 0 || index >= this._alignmentSequenceList.size()) {
951 throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
954 this._alignmentSequenceList.set(index, vAlignmentSequence);
960 * @param vAlignmentSequenceArray
962 public void setAlignmentSequence(
963 final uk.ac.vamsas.objects.core.AlignmentSequence[] vAlignmentSequenceArray) {
965 _alignmentSequenceList.clear();
967 for (int i = 0; i < vAlignmentSequenceArray.length; i++) {
968 this._alignmentSequenceList.add(vAlignmentSequenceArray[i]);
973 * Sets the value of '_alignmentSequenceList' by copying the
974 * given Vector. All elements will be checked for type safety.
976 * @param vAlignmentSequenceList the Vector to copy.
978 public void setAlignmentSequence(
979 final java.util.Vector vAlignmentSequenceList) {
981 this._alignmentSequenceList.clear();
983 this._alignmentSequenceList.addAll(vAlignmentSequenceList);
987 * Sets the value of '_alignmentSequenceList' by setting it to
988 * the given Vector. No type checking is performed.
991 * @param alignmentSequenceVector the Vector to set.
993 public void setAlignmentSequenceAsReference(
994 final java.util.Vector alignmentSequenceVector) {
995 this._alignmentSequenceList = alignmentSequenceVector;
999 * Sets the value of field 'gapChar'.
1001 * @param gapChar the value of field 'gapChar'.
1003 public void setGapChar(
1004 final java.lang.String gapChar) {
1005 this._gapChar = gapChar;
1009 * Sets the value of field 'id'. The field 'id' has the
1010 * following description: Primary Key for vamsas object
1014 * @param id the value of field 'id'.
1017 final java.lang.String id) {
1022 * Sets the value of field 'modifiable'.
1024 * @param modifiable the value of field 'modifiable'.
1026 public void setModifiable(
1027 final java.lang.String modifiable) {
1028 this._modifiable = modifiable;
1036 * @throws java.lang.IndexOutOfBoundsException if the index
1037 * given is outside the bounds of the collection
1039 public void setProperty(
1041 final uk.ac.vamsas.objects.core.Property vProperty)
1042 throws java.lang.IndexOutOfBoundsException {
1043 // check bounds for index
1044 if (index < 0 || index >= this._propertyList.size()) {
1045 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
1048 this._propertyList.set(index, vProperty);
1054 * @param vPropertyArray
1056 public void setProperty(
1057 final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
1059 _propertyList.clear();
1061 for (int i = 0; i < vPropertyArray.length; i++) {
1062 this._propertyList.add(vPropertyArray[i]);
1067 * Sets the value of '_propertyList' by copying the given
1068 * Vector. All elements will be checked for type safety.
1070 * @param vPropertyList the Vector to copy.
1072 public void setProperty(
1073 final java.util.Vector vPropertyList) {
1075 this._propertyList.clear();
1077 this._propertyList.addAll(vPropertyList);
1081 * Sets the value of '_propertyList' by setting it to the given
1082 * Vector. No type checking is performed.
1085 * @param propertyVector the Vector to set.
1087 public void setPropertyAsReference(
1088 final java.util.Vector propertyVector) {
1089 this._propertyList = propertyVector;
1093 * Sets the value of field 'provenance'.
1095 * @param provenance the value of field 'provenance'.
1097 public void setProvenance(
1098 final uk.ac.vamsas.objects.core.Provenance provenance) {
1099 this._provenance = provenance;
1107 * @throws java.lang.IndexOutOfBoundsException if the index
1108 * given is outside the bounds of the collection
1110 public void setTree(
1112 final uk.ac.vamsas.objects.core.Tree vTree)
1113 throws java.lang.IndexOutOfBoundsException {
1114 // check bounds for index
1115 if (index < 0 || index >= this._treeList.size()) {
1116 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
1119 this._treeList.set(index, vTree);
1127 public void setTree(
1128 final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
1132 for (int i = 0; i < vTreeArray.length; i++) {
1133 this._treeList.add(vTreeArray[i]);
1138 * Sets the value of '_treeList' by copying the given Vector.
1139 * All elements will be checked for type safety.
1141 * @param vTreeList the Vector to copy.
1143 public void setTree(
1144 final java.util.Vector vTreeList) {
1146 this._treeList.clear();
1148 this._treeList.addAll(vTreeList);
1152 * Sets the value of '_treeList' by setting it to the given
1153 * Vector. No type checking is performed.
1156 * @param treeVector the Vector to set.
1158 public void setTreeAsReference(
1159 final java.util.Vector treeVector) {
1160 this._treeList = treeVector;
1167 * @throws org.exolab.castor.xml.MarshalException if object is
1168 * null or if any SAXException is thrown during marshaling
1169 * @throws org.exolab.castor.xml.ValidationException if this
1170 * object is an invalid instance according to the schema
1171 * @return the unmarshaled uk.ac.vamsas.objects.core.Alignment
1173 public static uk.ac.vamsas.objects.core.Alignment unmarshal(
1174 final java.io.Reader reader)
1175 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1176 return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Alignment.class, reader);
1182 * @throws org.exolab.castor.xml.ValidationException if this
1183 * object is an invalid instance according to the schema
1185 public void validate(
1187 throws org.exolab.castor.xml.ValidationException {
1188 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1189 validator.validate(this);