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 Tree extends uk.ac.vamsas.client.Vobject
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * Primary Key for vamsas object referencing
34 private java.lang.String _id;
39 private java.lang.String _modifiable;
44 private java.lang.String _title;
49 private java.util.Vector _newickList;
52 * node identity and mapping data between tree
53 * representations and vamsas document objects
55 private java.util.Vector _treenodeList;
58 * Field _propertyList.
60 private java.util.Vector _propertyList;
65 private uk.ac.vamsas.objects.core.Provenance _provenance;
74 this._newickList = new java.util.Vector();
75 this._treenodeList = new java.util.Vector();
76 this._propertyList = new java.util.Vector();
88 * @throws java.lang.IndexOutOfBoundsException if the index
89 * given is outside the bounds of the collection
91 public void addNewick(
92 final uk.ac.vamsas.objects.core.Newick vNewick)
93 throws java.lang.IndexOutOfBoundsException {
94 this._newickList.addElement(vNewick);
102 * @throws java.lang.IndexOutOfBoundsException if the index
103 * given is outside the bounds of the collection
105 public void addNewick(
107 final uk.ac.vamsas.objects.core.Newick vNewick)
108 throws java.lang.IndexOutOfBoundsException {
109 this._newickList.add(index, vNewick);
116 * @throws java.lang.IndexOutOfBoundsException if the index
117 * given is outside the bounds of the collection
119 public void addProperty(
120 final uk.ac.vamsas.objects.core.Property vProperty)
121 throws java.lang.IndexOutOfBoundsException {
122 this._propertyList.addElement(vProperty);
130 * @throws java.lang.IndexOutOfBoundsException if the index
131 * given is outside the bounds of the collection
133 public void addProperty(
135 final uk.ac.vamsas.objects.core.Property vProperty)
136 throws java.lang.IndexOutOfBoundsException {
137 this._propertyList.add(index, vProperty);
144 * @throws java.lang.IndexOutOfBoundsException if the index
145 * given is outside the bounds of the collection
147 public void addTreenode(
148 final uk.ac.vamsas.objects.core.Treenode vTreenode)
149 throws java.lang.IndexOutOfBoundsException {
150 this._treenodeList.addElement(vTreenode);
158 * @throws java.lang.IndexOutOfBoundsException if the index
159 * given is outside the bounds of the collection
161 public void addTreenode(
163 final uk.ac.vamsas.objects.core.Treenode vTreenode)
164 throws java.lang.IndexOutOfBoundsException {
165 this._treenodeList.add(index, vTreenode);
169 * Method enumerateNewick.
171 * @return an Enumeration over all
172 * uk.ac.vamsas.objects.core.Newick elements
174 public java.util.Enumeration enumerateNewick(
176 return this._newickList.elements();
180 * Method enumerateProperty.
182 * @return an Enumeration over all
183 * uk.ac.vamsas.objects.core.Property elements
185 public java.util.Enumeration enumerateProperty(
187 return this._propertyList.elements();
191 * Method enumerateTreenode.
193 * @return an Enumeration over all
194 * uk.ac.vamsas.objects.core.Treenode elements
196 public java.util.Enumeration enumerateTreenode(
198 return this._treenodeList.elements();
202 * Overrides the java.lang.Object.equals method.
205 * @return true if the objects are equal.
207 public boolean equals(
208 final java.lang.Object obj) {
212 if (super.equals(obj)==false)
215 if (obj instanceof Tree) {
217 Tree temp = (Tree)obj;
220 if (this._id != null) {
221 if (temp._id == null) return false;
222 if (this._id != temp._id) {
223 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
224 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
225 if (thcycle!=tmcycle) {
226 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
227 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
231 if (!this._id.equals(temp._id)) {
232 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
233 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
236 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
237 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
240 } else if (temp._id != null)
242 if (this._modifiable != null) {
243 if (temp._modifiable == null) return false;
244 if (this._modifiable != temp._modifiable) {
245 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
246 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
247 if (thcycle!=tmcycle) {
248 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
249 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
253 if (!this._modifiable.equals(temp._modifiable)) {
254 org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
255 org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
258 org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
259 org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
262 } else if (temp._modifiable != null)
264 if (this._title != null) {
265 if (temp._title == null) return false;
266 if (this._title != temp._title) {
267 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._title);
268 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._title);
269 if (thcycle!=tmcycle) {
270 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._title); };
271 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); };
275 if (!this._title.equals(temp._title)) {
276 org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
277 org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
280 org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
281 org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
284 } else if (temp._title != null)
286 if (this._newickList != null) {
287 if (temp._newickList == null) return false;
288 if (this._newickList != temp._newickList) {
289 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._newickList);
290 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._newickList);
291 if (thcycle!=tmcycle) {
292 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList); };
293 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList); };
297 if (!this._newickList.equals(temp._newickList)) {
298 org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
299 org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
302 org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
303 org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
306 } else if (temp._newickList != null)
308 if (this._treenodeList != null) {
309 if (temp._treenodeList == null) return false;
310 if (this._treenodeList != temp._treenodeList) {
311 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treenodeList);
312 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treenodeList);
313 if (thcycle!=tmcycle) {
314 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList); };
315 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList); };
319 if (!this._treenodeList.equals(temp._treenodeList)) {
320 org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
321 org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
324 org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
325 org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
328 } else if (temp._treenodeList != null)
330 if (this._propertyList != null) {
331 if (temp._propertyList == null) return false;
332 if (this._propertyList != temp._propertyList) {
333 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
334 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
335 if (thcycle!=tmcycle) {
336 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
337 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
341 if (!this._propertyList.equals(temp._propertyList)) {
342 org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
343 org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
346 org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
347 org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
350 } else if (temp._propertyList != null)
352 if (this._provenance != null) {
353 if (temp._provenance == null) return false;
354 if (this._provenance != temp._provenance) {
355 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
356 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
357 if (thcycle!=tmcycle) {
358 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
359 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
363 if (!this._provenance.equals(temp._provenance)) {
364 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
365 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
368 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
369 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
372 } else if (temp._provenance != null)
380 * Returns the value of field 'id'. The field 'id' has the
381 * following description: Primary Key for vamsas object
384 * @return the value of field 'Id'.
386 public java.lang.String getId(
392 * Returns the value of field 'modifiable'.
394 * @return the value of field 'Modifiable'.
396 public java.lang.String getModifiable(
398 return this._modifiable;
405 * @throws java.lang.IndexOutOfBoundsException if the index
406 * given is outside the bounds of the collection
407 * @return the value of the uk.ac.vamsas.objects.core.Newick at
410 public uk.ac.vamsas.objects.core.Newick getNewick(
412 throws java.lang.IndexOutOfBoundsException {
413 // check bounds for index
414 if (index < 0 || index >= this._newickList.size()) {
415 throw new IndexOutOfBoundsException("getNewick: Index value '" + index + "' not in range [0.." + (this._newickList.size() - 1) + "]");
418 return (uk.ac.vamsas.objects.core.Newick) _newickList.get(index);
422 * Method getNewick.Returns the contents of the collection in
423 * an Array. <p>Note: Just in case the collection contents
424 * are changing in another thread, we pass a 0-length Array of
425 * the correct type into the API call. This way we <i>know</i>
426 * that the Array returned is of exactly the correct length.
428 * @return this collection as an Array
430 public uk.ac.vamsas.objects.core.Newick[] getNewick(
432 uk.ac.vamsas.objects.core.Newick[] array = new uk.ac.vamsas.objects.core.Newick[0];
433 return (uk.ac.vamsas.objects.core.Newick[]) this._newickList.toArray(array);
437 * Method getNewickAsReference.Returns a reference to
438 * '_newickList'. No type checking is performed on any
439 * modifications to the Vector.
441 * @return a reference to the Vector backing this class
443 public java.util.Vector getNewickAsReference(
445 return this._newickList;
449 * Method getNewickCount.
451 * @return the size of this collection
453 public int getNewickCount(
455 return this._newickList.size();
459 * Method getProperty.
462 * @throws java.lang.IndexOutOfBoundsException if the index
463 * given is outside the bounds of the collection
464 * @return the value of the uk.ac.vamsas.objects.core.Property
467 public uk.ac.vamsas.objects.core.Property getProperty(
469 throws java.lang.IndexOutOfBoundsException {
470 // check bounds for index
471 if (index < 0 || index >= this._propertyList.size()) {
472 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
475 return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
479 * Method getProperty.Returns the contents of the collection in
480 * an Array. <p>Note: Just in case the collection contents
481 * are changing in another thread, we pass a 0-length Array of
482 * the correct type into the API call. This way we <i>know</i>
483 * that the Array returned is of exactly the correct length.
485 * @return this collection as an Array
487 public uk.ac.vamsas.objects.core.Property[] getProperty(
489 uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
490 return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
494 * Method getPropertyAsReference.Returns a reference to
495 * '_propertyList'. No type checking is performed on any
496 * modifications to the Vector.
498 * @return a reference to the Vector backing this class
500 public java.util.Vector getPropertyAsReference(
502 return this._propertyList;
506 * Method getPropertyCount.
508 * @return the size of this collection
510 public int getPropertyCount(
512 return this._propertyList.size();
516 * Returns the value of field 'provenance'.
518 * @return the value of field 'Provenance'.
520 public uk.ac.vamsas.objects.core.Provenance getProvenance(
522 return this._provenance;
526 * Returns the value of field 'title'.
528 * @return the value of field 'Title'.
530 public java.lang.String getTitle(
536 * Method getTreenode.
539 * @throws java.lang.IndexOutOfBoundsException if the index
540 * given is outside the bounds of the collection
541 * @return the value of the uk.ac.vamsas.objects.core.Treenode
544 public uk.ac.vamsas.objects.core.Treenode getTreenode(
546 throws java.lang.IndexOutOfBoundsException {
547 // check bounds for index
548 if (index < 0 || index >= this._treenodeList.size()) {
549 throw new IndexOutOfBoundsException("getTreenode: Index value '" + index + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
552 return (uk.ac.vamsas.objects.core.Treenode) _treenodeList.get(index);
556 * Method getTreenode.Returns the contents of the collection in
557 * an Array. <p>Note: Just in case the collection contents
558 * are changing in another thread, we pass a 0-length Array of
559 * the correct type into the API call. This way we <i>know</i>
560 * that the Array returned is of exactly the correct length.
562 * @return this collection as an Array
564 public uk.ac.vamsas.objects.core.Treenode[] getTreenode(
566 uk.ac.vamsas.objects.core.Treenode[] array = new uk.ac.vamsas.objects.core.Treenode[0];
567 return (uk.ac.vamsas.objects.core.Treenode[]) this._treenodeList.toArray(array);
571 * Method getTreenodeAsReference.Returns a reference to
572 * '_treenodeList'. No type checking is performed on any
573 * modifications to the Vector.
575 * @return a reference to the Vector backing this class
577 public java.util.Vector getTreenodeAsReference(
579 return this._treenodeList;
583 * Method getTreenodeCount.
585 * @return the size of this collection
587 public int getTreenodeCount(
589 return this._treenodeList.size();
593 * Overrides the java.lang.Object.hashCode method.
595 * The following steps came from <b>Effective Java Programming
596 * Language Guide</b> by Joshua Bloch, Chapter 3
598 * @return a hash code value for the object.
602 int result = super.hashCode();
606 && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
607 result = 37 * result + _id.hashCode();
608 org.castor.util.CycleBreaker.releaseCycleHandle(_id);
610 if (_modifiable != null
611 && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
612 result = 37 * result + _modifiable.hashCode();
613 org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
616 && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
617 result = 37 * result + _title.hashCode();
618 org.castor.util.CycleBreaker.releaseCycleHandle(_title);
620 if (_newickList != null
621 && !org.castor.util.CycleBreaker.startingToCycle(_newickList)) {
622 result = 37 * result + _newickList.hashCode();
623 org.castor.util.CycleBreaker.releaseCycleHandle(_newickList);
625 if (_treenodeList != null
626 && !org.castor.util.CycleBreaker.startingToCycle(_treenodeList)) {
627 result = 37 * result + _treenodeList.hashCode();
628 org.castor.util.CycleBreaker.releaseCycleHandle(_treenodeList);
630 if (_propertyList != null
631 && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
632 result = 37 * result + _propertyList.hashCode();
633 org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
635 if (_provenance != null
636 && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
637 result = 37 * result + _provenance.hashCode();
638 org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
647 * @return true if this object is valid according to the schema
649 public boolean isValid(
653 } catch (org.exolab.castor.xml.ValidationException vex) {
663 * @throws org.exolab.castor.xml.MarshalException if object is
664 * null or if any SAXException is thrown during marshaling
665 * @throws org.exolab.castor.xml.ValidationException if this
666 * object is an invalid instance according to the schema
669 final java.io.Writer out)
670 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
671 Marshaller.marshal(this, out);
678 * @throws java.io.IOException if an IOException occurs during
680 * @throws org.exolab.castor.xml.ValidationException if this
681 * object is an invalid instance according to the schema
682 * @throws org.exolab.castor.xml.MarshalException if object is
683 * null or if any SAXException is thrown during marshaling
686 final org.xml.sax.ContentHandler handler)
687 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
688 Marshaller.marshal(this, handler);
693 public void removeAllNewick(
695 this._newickList.clear();
700 public void removeAllProperty(
702 this._propertyList.clear();
707 public void removeAllTreenode(
709 this._treenodeList.clear();
713 * Method removeNewick.
716 * @return true if the object was removed from the collection.
718 public boolean removeNewick(
719 final uk.ac.vamsas.objects.core.Newick vNewick) {
720 boolean removed = _newickList.remove(vNewick);
725 * Method removeNewickAt.
728 * @return the element removed from the collection
730 public uk.ac.vamsas.objects.core.Newick removeNewickAt(
732 java.lang.Object obj = this._newickList.remove(index);
733 return (uk.ac.vamsas.objects.core.Newick) obj;
737 * Method removeProperty.
740 * @return true if the object was removed from the collection.
742 public boolean removeProperty(
743 final uk.ac.vamsas.objects.core.Property vProperty) {
744 boolean removed = _propertyList.remove(vProperty);
749 * Method removePropertyAt.
752 * @return the element removed from the collection
754 public uk.ac.vamsas.objects.core.Property removePropertyAt(
756 java.lang.Object obj = this._propertyList.remove(index);
757 return (uk.ac.vamsas.objects.core.Property) obj;
761 * Method removeTreenode.
764 * @return true if the object was removed from the collection.
766 public boolean removeTreenode(
767 final uk.ac.vamsas.objects.core.Treenode vTreenode) {
768 boolean removed = _treenodeList.remove(vTreenode);
773 * Method removeTreenodeAt.
776 * @return the element removed from the collection
778 public uk.ac.vamsas.objects.core.Treenode removeTreenodeAt(
780 java.lang.Object obj = this._treenodeList.remove(index);
781 return (uk.ac.vamsas.objects.core.Treenode) obj;
785 * Sets the value of field 'id'. The field 'id' has the
786 * following description: Primary Key for vamsas object
789 * @param id the value of field 'id'.
792 final java.lang.String id) {
797 * Sets the value of field 'modifiable'.
799 * @param modifiable the value of field 'modifiable'.
801 public void setModifiable(
802 final java.lang.String modifiable) {
803 this._modifiable = modifiable;
811 * @throws java.lang.IndexOutOfBoundsException if the index
812 * given is outside the bounds of the collection
814 public void setNewick(
816 final uk.ac.vamsas.objects.core.Newick vNewick)
817 throws java.lang.IndexOutOfBoundsException {
818 // check bounds for index
819 if (index < 0 || index >= this._newickList.size()) {
820 throw new IndexOutOfBoundsException("setNewick: Index value '" + index + "' not in range [0.." + (this._newickList.size() - 1) + "]");
823 this._newickList.set(index, vNewick);
829 * @param vNewickArray
831 public void setNewick(
832 final uk.ac.vamsas.objects.core.Newick[] vNewickArray) {
836 for (int i = 0; i < vNewickArray.length; i++) {
837 this._newickList.add(vNewickArray[i]);
842 * Sets the value of '_newickList' by copying the given Vector.
843 * All elements will be checked for type safety.
845 * @param vNewickList the Vector to copy.
847 public void setNewick(
848 final java.util.Vector vNewickList) {
850 this._newickList.clear();
852 this._newickList.addAll(vNewickList);
856 * Sets the value of '_newickList' by setting it to the given
857 * Vector. No type checking is performed.
860 * @param newickVector the Vector to set.
862 public void setNewickAsReference(
863 final java.util.Vector newickVector) {
864 this._newickList = newickVector;
872 * @throws java.lang.IndexOutOfBoundsException if the index
873 * given is outside the bounds of the collection
875 public void setProperty(
877 final uk.ac.vamsas.objects.core.Property vProperty)
878 throws java.lang.IndexOutOfBoundsException {
879 // check bounds for index
880 if (index < 0 || index >= this._propertyList.size()) {
881 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
884 this._propertyList.set(index, vProperty);
890 * @param vPropertyArray
892 public void setProperty(
893 final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
895 _propertyList.clear();
897 for (int i = 0; i < vPropertyArray.length; i++) {
898 this._propertyList.add(vPropertyArray[i]);
903 * Sets the value of '_propertyList' by copying the given
904 * Vector. All elements will be checked for type safety.
906 * @param vPropertyList the Vector to copy.
908 public void setProperty(
909 final java.util.Vector vPropertyList) {
911 this._propertyList.clear();
913 this._propertyList.addAll(vPropertyList);
917 * Sets the value of '_propertyList' by setting it to the given
918 * Vector. No type checking is performed.
921 * @param propertyVector the Vector to set.
923 public void setPropertyAsReference(
924 final java.util.Vector propertyVector) {
925 this._propertyList = propertyVector;
929 * Sets the value of field 'provenance'.
931 * @param provenance the value of field 'provenance'.
933 public void setProvenance(
934 final uk.ac.vamsas.objects.core.Provenance provenance) {
935 this._provenance = provenance;
939 * Sets the value of field 'title'.
941 * @param title the value of field 'title'.
943 public void setTitle(
944 final java.lang.String title) {
953 * @throws java.lang.IndexOutOfBoundsException if the index
954 * given is outside the bounds of the collection
956 public void setTreenode(
958 final uk.ac.vamsas.objects.core.Treenode vTreenode)
959 throws java.lang.IndexOutOfBoundsException {
960 // check bounds for index
961 if (index < 0 || index >= this._treenodeList.size()) {
962 throw new IndexOutOfBoundsException("setTreenode: Index value '" + index + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
965 this._treenodeList.set(index, vTreenode);
971 * @param vTreenodeArray
973 public void setTreenode(
974 final uk.ac.vamsas.objects.core.Treenode[] vTreenodeArray) {
976 _treenodeList.clear();
978 for (int i = 0; i < vTreenodeArray.length; i++) {
979 this._treenodeList.add(vTreenodeArray[i]);
984 * Sets the value of '_treenodeList' by copying the given
985 * Vector. All elements will be checked for type safety.
987 * @param vTreenodeList the Vector to copy.
989 public void setTreenode(
990 final java.util.Vector vTreenodeList) {
992 this._treenodeList.clear();
994 this._treenodeList.addAll(vTreenodeList);
998 * Sets the value of '_treenodeList' by setting it to the given
999 * Vector. No type checking is performed.
1002 * @param treenodeVector the Vector to set.
1004 public void setTreenodeAsReference(
1005 final java.util.Vector treenodeVector) {
1006 this._treenodeList = treenodeVector;
1013 * @throws org.exolab.castor.xml.MarshalException if object is
1014 * null or if any SAXException is thrown during marshaling
1015 * @throws org.exolab.castor.xml.ValidationException if this
1016 * object is an invalid instance according to the schema
1017 * @return the unmarshaled uk.ac.vamsas.objects.core.Tree
1019 public static uk.ac.vamsas.objects.core.Tree unmarshal(
1020 final java.io.Reader reader)
1021 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1022 return (uk.ac.vamsas.objects.core.Tree) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Tree.class, reader);
1028 * @throws org.exolab.castor.xml.ValidationException if this
1029 * object is an invalid instance according to the schema
1031 public void validate(
1033 throws org.exolab.castor.xml.ValidationException {
1034 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1035 validator.validate(this);