39eb763c874053e2f0346b604c8c9290df3dc333
[vamsas.git] / src / uk / ac / vamsas / objects / core / Tree.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class Tree.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class Tree extends uk.ac.vamsas.client.Vobject 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * Primary Key for vamsas object referencing 
33      */
34     private java.lang.String _id;
35
36     /**
37      * Field _modifiable.
38      */
39     private java.lang.String _modifiable;
40
41     /**
42      * Field _title.
43      */
44     private java.lang.String _title;
45
46     /**
47      * Field _newickList.
48      */
49     private java.util.Vector _newickList;
50
51     /**
52      * node identity and mapping data between tree
53      *  representations and vamsas document objects 
54      */
55     private java.util.Vector _treenodeList;
56
57     /**
58      * Field _propertyList.
59      */
60     private java.util.Vector _propertyList;
61
62     /**
63      * Field _provenance.
64      */
65     private uk.ac.vamsas.objects.core.Provenance _provenance;
66
67
68       //----------------/
69      //- Constructors -/
70     //----------------/
71
72     public Tree() {
73         super();
74         this._newickList = new java.util.Vector();
75         this._treenodeList = new java.util.Vector();
76         this._propertyList = new java.util.Vector();
77     }
78
79
80       //-----------/
81      //- Methods -/
82     //-----------/
83
84     /**
85      * 
86      * 
87      * @param vNewick
88      * @throws java.lang.IndexOutOfBoundsException if the index
89      * given is outside the bounds of the collection
90      */
91     public void addNewick(
92             final uk.ac.vamsas.objects.core.Newick vNewick)
93     throws java.lang.IndexOutOfBoundsException {
94         this._newickList.addElement(vNewick);
95     }
96
97     /**
98      * 
99      * 
100      * @param index
101      * @param vNewick
102      * @throws java.lang.IndexOutOfBoundsException if the index
103      * given is outside the bounds of the collection
104      */
105     public void addNewick(
106             final int index,
107             final uk.ac.vamsas.objects.core.Newick vNewick)
108     throws java.lang.IndexOutOfBoundsException {
109         this._newickList.add(index, vNewick);
110     }
111
112     /**
113      * 
114      * 
115      * @param vProperty
116      * @throws java.lang.IndexOutOfBoundsException if the index
117      * given is outside the bounds of the collection
118      */
119     public void addProperty(
120             final uk.ac.vamsas.objects.core.Property vProperty)
121     throws java.lang.IndexOutOfBoundsException {
122         this._propertyList.addElement(vProperty);
123     }
124
125     /**
126      * 
127      * 
128      * @param index
129      * @param vProperty
130      * @throws java.lang.IndexOutOfBoundsException if the index
131      * given is outside the bounds of the collection
132      */
133     public void addProperty(
134             final int index,
135             final uk.ac.vamsas.objects.core.Property vProperty)
136     throws java.lang.IndexOutOfBoundsException {
137         this._propertyList.add(index, vProperty);
138     }
139
140     /**
141      * 
142      * 
143      * @param vTreenode
144      * @throws java.lang.IndexOutOfBoundsException if the index
145      * given is outside the bounds of the collection
146      */
147     public void addTreenode(
148             final uk.ac.vamsas.objects.core.Treenode vTreenode)
149     throws java.lang.IndexOutOfBoundsException {
150         this._treenodeList.addElement(vTreenode);
151     }
152
153     /**
154      * 
155      * 
156      * @param index
157      * @param vTreenode
158      * @throws java.lang.IndexOutOfBoundsException if the index
159      * given is outside the bounds of the collection
160      */
161     public void addTreenode(
162             final int index,
163             final uk.ac.vamsas.objects.core.Treenode vTreenode)
164     throws java.lang.IndexOutOfBoundsException {
165         this._treenodeList.add(index, vTreenode);
166     }
167
168     /**
169      * Method enumerateNewick.
170      * 
171      * @return an Enumeration over all
172      * uk.ac.vamsas.objects.core.Newick elements
173      */
174     public java.util.Enumeration enumerateNewick(
175     ) {
176         return this._newickList.elements();
177     }
178
179     /**
180      * Method enumerateProperty.
181      * 
182      * @return an Enumeration over all
183      * uk.ac.vamsas.objects.core.Property elements
184      */
185     public java.util.Enumeration enumerateProperty(
186     ) {
187         return this._propertyList.elements();
188     }
189
190     /**
191      * Method enumerateTreenode.
192      * 
193      * @return an Enumeration over all
194      * uk.ac.vamsas.objects.core.Treenode elements
195      */
196     public java.util.Enumeration enumerateTreenode(
197     ) {
198         return this._treenodeList.elements();
199     }
200
201     /**
202      * Overrides the java.lang.Object.equals method.
203      * 
204      * @param obj
205      * @return true if the objects are equal.
206      */
207     public boolean equals(
208             final java.lang.Object obj) {
209         if ( this == obj )
210             return true;
211         
212         if (super.equals(obj)==false)
213             return false;
214         
215         if (obj instanceof Tree) {
216         
217             Tree temp = (Tree)obj;
218             boolean thcycle;
219             boolean tmcycle;
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); };
228                         return false;
229                     }
230                     if (!thcycle) {
231                         if (!this._id.equals(temp._id)) {
232                             org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
233                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
234                             return false;
235                         }
236                         org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
237                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
238                     }
239                 }
240             } else if (temp._id != null)
241                 return false;
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); };
250                         return false;
251                     }
252                     if (!thcycle) {
253                         if (!this._modifiable.equals(temp._modifiable)) {
254                             org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
255                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
256                             return false;
257                         }
258                         org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
259                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
260                     }
261                 }
262             } else if (temp._modifiable != null)
263                 return false;
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); };
272                         return false;
273                     }
274                     if (!thcycle) {
275                         if (!this._title.equals(temp._title)) {
276                             org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
277                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
278                             return false;
279                         }
280                         org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
281                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
282                     }
283                 }
284             } else if (temp._title != null)
285                 return false;
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); };
294                         return false;
295                     }
296                     if (!thcycle) {
297                         if (!this._newickList.equals(temp._newickList)) {
298                             org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
299                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
300                             return false;
301                         }
302                         org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
303                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
304                     }
305                 }
306             } else if (temp._newickList != null)
307                 return false;
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); };
316                         return false;
317                     }
318                     if (!thcycle) {
319                         if (!this._treenodeList.equals(temp._treenodeList)) {
320                             org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
321                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
322                             return false;
323                         }
324                         org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
325                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
326                     }
327                 }
328             } else if (temp._treenodeList != null)
329                 return false;
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); };
338                         return false;
339                     }
340                     if (!thcycle) {
341                         if (!this._propertyList.equals(temp._propertyList)) {
342                             org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
343                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
344                             return false;
345                         }
346                         org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
347                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
348                     }
349                 }
350             } else if (temp._propertyList != null)
351                 return false;
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); };
360                         return false;
361                     }
362                     if (!thcycle) {
363                         if (!this._provenance.equals(temp._provenance)) {
364                             org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
365                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
366                             return false;
367                         }
368                         org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
369                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
370                     }
371                 }
372             } else if (temp._provenance != null)
373                 return false;
374             return true;
375         }
376         return false;
377     }
378
379     /**
380      * Returns the value of field 'id'. The field 'id' has the
381      * following description: Primary Key for vamsas object
382      * referencing 
383      * 
384      * @return the value of field 'Id'.
385      */
386     public java.lang.String getId(
387     ) {
388         return this._id;
389     }
390
391     /**
392      * Returns the value of field 'modifiable'.
393      * 
394      * @return the value of field 'Modifiable'.
395      */
396     public java.lang.String getModifiable(
397     ) {
398         return this._modifiable;
399     }
400
401     /**
402      * Method getNewick.
403      * 
404      * @param index
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
408      * the given index
409      */
410     public uk.ac.vamsas.objects.core.Newick getNewick(
411             final int index)
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) + "]");
416         }
417         
418         return (uk.ac.vamsas.objects.core.Newick) _newickList.get(index);
419     }
420
421     /**
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.
427      * 
428      * @return this collection as an Array
429      */
430     public uk.ac.vamsas.objects.core.Newick[] getNewick(
431     ) {
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);
434     }
435
436     /**
437      * Method getNewickAsReference.Returns a reference to
438      * '_newickList'. No type checking is performed on any
439      * modifications to the Vector.
440      * 
441      * @return a reference to the Vector backing this class
442      */
443     public java.util.Vector getNewickAsReference(
444     ) {
445         return this._newickList;
446     }
447
448     /**
449      * Method getNewickCount.
450      * 
451      * @return the size of this collection
452      */
453     public int getNewickCount(
454     ) {
455         return this._newickList.size();
456     }
457
458     /**
459      * Method getProperty.
460      * 
461      * @param index
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
465      * at the given index
466      */
467     public uk.ac.vamsas.objects.core.Property getProperty(
468             final int index)
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) + "]");
473         }
474         
475         return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
476     }
477
478     /**
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.
484      * 
485      * @return this collection as an Array
486      */
487     public uk.ac.vamsas.objects.core.Property[] getProperty(
488     ) {
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);
491     }
492
493     /**
494      * Method getPropertyAsReference.Returns a reference to
495      * '_propertyList'. No type checking is performed on any
496      * modifications to the Vector.
497      * 
498      * @return a reference to the Vector backing this class
499      */
500     public java.util.Vector getPropertyAsReference(
501     ) {
502         return this._propertyList;
503     }
504
505     /**
506      * Method getPropertyCount.
507      * 
508      * @return the size of this collection
509      */
510     public int getPropertyCount(
511     ) {
512         return this._propertyList.size();
513     }
514
515     /**
516      * Returns the value of field 'provenance'.
517      * 
518      * @return the value of field 'Provenance'.
519      */
520     public uk.ac.vamsas.objects.core.Provenance getProvenance(
521     ) {
522         return this._provenance;
523     }
524
525     /**
526      * Returns the value of field 'title'.
527      * 
528      * @return the value of field 'Title'.
529      */
530     public java.lang.String getTitle(
531     ) {
532         return this._title;
533     }
534
535     /**
536      * Method getTreenode.
537      * 
538      * @param index
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
542      * at the given index
543      */
544     public uk.ac.vamsas.objects.core.Treenode getTreenode(
545             final int index)
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) + "]");
550         }
551         
552         return (uk.ac.vamsas.objects.core.Treenode) _treenodeList.get(index);
553     }
554
555     /**
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.
561      * 
562      * @return this collection as an Array
563      */
564     public uk.ac.vamsas.objects.core.Treenode[] getTreenode(
565     ) {
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);
568     }
569
570     /**
571      * Method getTreenodeAsReference.Returns a reference to
572      * '_treenodeList'. No type checking is performed on any
573      * modifications to the Vector.
574      * 
575      * @return a reference to the Vector backing this class
576      */
577     public java.util.Vector getTreenodeAsReference(
578     ) {
579         return this._treenodeList;
580     }
581
582     /**
583      * Method getTreenodeCount.
584      * 
585      * @return the size of this collection
586      */
587     public int getTreenodeCount(
588     ) {
589         return this._treenodeList.size();
590     }
591
592     /**
593      * Overrides the java.lang.Object.hashCode method.
594      * <p>
595      * The following steps came from <b>Effective Java Programming
596      * Language Guide</b> by Joshua Bloch, Chapter 3
597      * 
598      * @return a hash code value for the object.
599      */
600     public int hashCode(
601     ) {
602         int result = super.hashCode();
603         
604         long tmp;
605         if (_id != null
606             && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
607            result = 37 * result + _id.hashCode();
608            org.castor.util.CycleBreaker.releaseCycleHandle(_id);
609         }
610         if (_modifiable != null
611             && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
612            result = 37 * result + _modifiable.hashCode();
613            org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
614         }
615         if (_title != null
616             && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
617            result = 37 * result + _title.hashCode();
618            org.castor.util.CycleBreaker.releaseCycleHandle(_title);
619         }
620         if (_newickList != null
621             && !org.castor.util.CycleBreaker.startingToCycle(_newickList)) {
622            result = 37 * result + _newickList.hashCode();
623            org.castor.util.CycleBreaker.releaseCycleHandle(_newickList);
624         }
625         if (_treenodeList != null
626             && !org.castor.util.CycleBreaker.startingToCycle(_treenodeList)) {
627            result = 37 * result + _treenodeList.hashCode();
628            org.castor.util.CycleBreaker.releaseCycleHandle(_treenodeList);
629         }
630         if (_propertyList != null
631             && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
632            result = 37 * result + _propertyList.hashCode();
633            org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
634         }
635         if (_provenance != null
636             && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
637            result = 37 * result + _provenance.hashCode();
638            org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
639         }
640         
641         return result;
642     }
643
644     /**
645      * Method isValid.
646      * 
647      * @return true if this object is valid according to the schema
648      */
649     public boolean isValid(
650     ) {
651         try {
652             validate();
653         } catch (org.exolab.castor.xml.ValidationException vex) {
654             return false;
655         }
656         return true;
657     }
658
659     /**
660      * 
661      * 
662      * @param out
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
667      */
668     public void marshal(
669             final java.io.Writer out)
670     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
671         Marshaller.marshal(this, out);
672     }
673
674     /**
675      * 
676      * 
677      * @param handler
678      * @throws java.io.IOException if an IOException occurs during
679      * marshaling
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
684      */
685     public void marshal(
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);
689     }
690
691     /**
692      */
693     public void removeAllNewick(
694     ) {
695         this._newickList.clear();
696     }
697
698     /**
699      */
700     public void removeAllProperty(
701     ) {
702         this._propertyList.clear();
703     }
704
705     /**
706      */
707     public void removeAllTreenode(
708     ) {
709         this._treenodeList.clear();
710     }
711
712     /**
713      * Method removeNewick.
714      * 
715      * @param vNewick
716      * @return true if the object was removed from the collection.
717      */
718     public boolean removeNewick(
719             final uk.ac.vamsas.objects.core.Newick vNewick) {
720         boolean removed = _newickList.remove(vNewick);
721         return removed;
722     }
723
724     /**
725      * Method removeNewickAt.
726      * 
727      * @param index
728      * @return the element removed from the collection
729      */
730     public uk.ac.vamsas.objects.core.Newick removeNewickAt(
731             final int index) {
732         java.lang.Object obj = this._newickList.remove(index);
733         return (uk.ac.vamsas.objects.core.Newick) obj;
734     }
735
736     /**
737      * Method removeProperty.
738      * 
739      * @param vProperty
740      * @return true if the object was removed from the collection.
741      */
742     public boolean removeProperty(
743             final uk.ac.vamsas.objects.core.Property vProperty) {
744         boolean removed = _propertyList.remove(vProperty);
745         return removed;
746     }
747
748     /**
749      * Method removePropertyAt.
750      * 
751      * @param index
752      * @return the element removed from the collection
753      */
754     public uk.ac.vamsas.objects.core.Property removePropertyAt(
755             final int index) {
756         java.lang.Object obj = this._propertyList.remove(index);
757         return (uk.ac.vamsas.objects.core.Property) obj;
758     }
759
760     /**
761      * Method removeTreenode.
762      * 
763      * @param vTreenode
764      * @return true if the object was removed from the collection.
765      */
766     public boolean removeTreenode(
767             final uk.ac.vamsas.objects.core.Treenode vTreenode) {
768         boolean removed = _treenodeList.remove(vTreenode);
769         return removed;
770     }
771
772     /**
773      * Method removeTreenodeAt.
774      * 
775      * @param index
776      * @return the element removed from the collection
777      */
778     public uk.ac.vamsas.objects.core.Treenode removeTreenodeAt(
779             final int index) {
780         java.lang.Object obj = this._treenodeList.remove(index);
781         return (uk.ac.vamsas.objects.core.Treenode) obj;
782     }
783
784     /**
785      * Sets the value of field 'id'. The field 'id' has the
786      * following description: Primary Key for vamsas object
787      * referencing 
788      * 
789      * @param id the value of field 'id'.
790      */
791     public void setId(
792             final java.lang.String id) {
793         this._id = id;
794     }
795
796     /**
797      * Sets the value of field 'modifiable'.
798      * 
799      * @param modifiable the value of field 'modifiable'.
800      */
801     public void setModifiable(
802             final java.lang.String modifiable) {
803         this._modifiable = modifiable;
804     }
805
806     /**
807      * 
808      * 
809      * @param index
810      * @param vNewick
811      * @throws java.lang.IndexOutOfBoundsException if the index
812      * given is outside the bounds of the collection
813      */
814     public void setNewick(
815             final int index,
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) + "]");
821         }
822         
823         this._newickList.set(index, vNewick);
824     }
825
826     /**
827      * 
828      * 
829      * @param vNewickArray
830      */
831     public void setNewick(
832             final uk.ac.vamsas.objects.core.Newick[] vNewickArray) {
833         //-- copy array
834         _newickList.clear();
835         
836         for (int i = 0; i < vNewickArray.length; i++) {
837                 this._newickList.add(vNewickArray[i]);
838         }
839     }
840
841     /**
842      * Sets the value of '_newickList' by copying the given Vector.
843      * All elements will be checked for type safety.
844      * 
845      * @param vNewickList the Vector to copy.
846      */
847     public void setNewick(
848             final java.util.Vector vNewickList) {
849         // copy vector
850         this._newickList.clear();
851         
852         this._newickList.addAll(vNewickList);
853     }
854
855     /**
856      * Sets the value of '_newickList' by setting it to the given
857      * Vector. No type checking is performed.
858      * @deprecated
859      * 
860      * @param newickVector the Vector to set.
861      */
862     public void setNewickAsReference(
863             final java.util.Vector newickVector) {
864         this._newickList = newickVector;
865     }
866
867     /**
868      * 
869      * 
870      * @param index
871      * @param vProperty
872      * @throws java.lang.IndexOutOfBoundsException if the index
873      * given is outside the bounds of the collection
874      */
875     public void setProperty(
876             final int index,
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) + "]");
882         }
883         
884         this._propertyList.set(index, vProperty);
885     }
886
887     /**
888      * 
889      * 
890      * @param vPropertyArray
891      */
892     public void setProperty(
893             final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
894         //-- copy array
895         _propertyList.clear();
896         
897         for (int i = 0; i < vPropertyArray.length; i++) {
898                 this._propertyList.add(vPropertyArray[i]);
899         }
900     }
901
902     /**
903      * Sets the value of '_propertyList' by copying the given
904      * Vector. All elements will be checked for type safety.
905      * 
906      * @param vPropertyList the Vector to copy.
907      */
908     public void setProperty(
909             final java.util.Vector vPropertyList) {
910         // copy vector
911         this._propertyList.clear();
912         
913         this._propertyList.addAll(vPropertyList);
914     }
915
916     /**
917      * Sets the value of '_propertyList' by setting it to the given
918      * Vector. No type checking is performed.
919      * @deprecated
920      * 
921      * @param propertyVector the Vector to set.
922      */
923     public void setPropertyAsReference(
924             final java.util.Vector propertyVector) {
925         this._propertyList = propertyVector;
926     }
927
928     /**
929      * Sets the value of field 'provenance'.
930      * 
931      * @param provenance the value of field 'provenance'.
932      */
933     public void setProvenance(
934             final uk.ac.vamsas.objects.core.Provenance provenance) {
935         this._provenance = provenance;
936     }
937
938     /**
939      * Sets the value of field 'title'.
940      * 
941      * @param title the value of field 'title'.
942      */
943     public void setTitle(
944             final java.lang.String title) {
945         this._title = title;
946     }
947
948     /**
949      * 
950      * 
951      * @param index
952      * @param vTreenode
953      * @throws java.lang.IndexOutOfBoundsException if the index
954      * given is outside the bounds of the collection
955      */
956     public void setTreenode(
957             final int index,
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) + "]");
963         }
964         
965         this._treenodeList.set(index, vTreenode);
966     }
967
968     /**
969      * 
970      * 
971      * @param vTreenodeArray
972      */
973     public void setTreenode(
974             final uk.ac.vamsas.objects.core.Treenode[] vTreenodeArray) {
975         //-- copy array
976         _treenodeList.clear();
977         
978         for (int i = 0; i < vTreenodeArray.length; i++) {
979                 this._treenodeList.add(vTreenodeArray[i]);
980         }
981     }
982
983     /**
984      * Sets the value of '_treenodeList' by copying the given
985      * Vector. All elements will be checked for type safety.
986      * 
987      * @param vTreenodeList the Vector to copy.
988      */
989     public void setTreenode(
990             final java.util.Vector vTreenodeList) {
991         // copy vector
992         this._treenodeList.clear();
993         
994         this._treenodeList.addAll(vTreenodeList);
995     }
996
997     /**
998      * Sets the value of '_treenodeList' by setting it to the given
999      * Vector. No type checking is performed.
1000      * @deprecated
1001      * 
1002      * @param treenodeVector the Vector to set.
1003      */
1004     public void setTreenodeAsReference(
1005             final java.util.Vector treenodeVector) {
1006         this._treenodeList = treenodeVector;
1007     }
1008
1009     /**
1010      * Method unmarshal.
1011      * 
1012      * @param reader
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
1018      */
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);
1023     }
1024
1025     /**
1026      * 
1027      * 
1028      * @throws org.exolab.castor.xml.ValidationException if this
1029      * object is an invalid instance according to the schema
1030      */
1031     public void validate(
1032     )
1033     throws org.exolab.castor.xml.ValidationException {
1034         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1035         validator.validate(this);
1036     }
1037
1038 }