applied LGPLv3 and source code formatting.
[vamsas.git] / src / uk / ac / vamsas / objects / core / NodeType.java
1 /*\r
2  * This file is part of the Vamsas Client version 0.1. \r
3  * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, \r
4  *  Andrew Waterhouse and Dominik Lindner.\r
5  * \r
6  * Earlier versions have also been incorporated into Jalview version 2.4 \r
7  * since 2008, and TOPALi version 2 since 2007.\r
8  * \r
9  * The Vamsas Client is free software: you can redistribute it and/or modify\r
10  * it under the terms of the GNU Lesser General Public License as published by\r
11  * the Free Software Foundation, either version 3 of the License, or\r
12  * (at your option) any later version.\r
13  *  \r
14  * The Vamsas Client is distributed in the hope that it will be useful,\r
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  * GNU Lesser General Public License for more details.\r
18  * \r
19  * You should have received a copy of the GNU Lesser General Public License\r
20  * along with the Vamsas Client.  If not, see <http://www.gnu.org/licenses/>.\r
21  */\r
22 package uk.ac.vamsas.objects.core;\r
23 \r
24 //---------------------------------/\r
25 //- Imported classes and packages -/\r
26 //---------------------------------/\r
27 \r
28 import org.exolab.castor.xml.Marshaller;\r
29 import org.exolab.castor.xml.Unmarshaller;\r
30 \r
31 /**\r
32  * Class NodeType.\r
33  * \r
34  * @version $Revision$ $Date$\r
35  */\r
36 public class NodeType extends uk.ac.vamsas.client.Vobject implements\r
37     java.io.Serializable {\r
38 \r
39   // --------------------------/\r
40   // - Class/Member Variables -/\r
41   // --------------------------/\r
42 \r
43   /**\r
44    * Primary Key for vamsas object referencing\r
45    */\r
46   private java.lang.String _id;\r
47 \r
48   /**\r
49    * Field _modifiable.\r
50    */\r
51   private java.lang.String _modifiable;\r
52 \r
53   /**\r
54    * Short name for this node\r
55    */\r
56   private java.lang.String _name;\r
57 \r
58   /**\r
59    * Descriptive text for this node\r
60    */\r
61   private java.lang.String _description;\r
62 \r
63   /**\r
64    * Direct associations between this node and any vamsas objects\r
65    */\r
66   private java.util.Vector _vrefList;\r
67 \r
68   /**\r
69    * Field _propertyList.\r
70    */\r
71   private java.util.Vector _propertyList;\r
72 \r
73   // ----------------/\r
74   // - Constructors -/\r
75   // ----------------/\r
76 \r
77   public NodeType() {\r
78     super();\r
79     this._vrefList = new java.util.Vector();\r
80     this._propertyList = new java.util.Vector();\r
81   }\r
82 \r
83   // -----------/\r
84   // - Methods -/\r
85   // -----------/\r
86 \r
87   /**\r
88    * \r
89    * \r
90    * @param vProperty\r
91    * @throws java.lang.IndexOutOfBoundsException\r
92    *           if the index given is outside the bounds of the collection\r
93    */\r
94   public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)\r
95       throws java.lang.IndexOutOfBoundsException {\r
96     this._propertyList.addElement(vProperty);\r
97   }\r
98 \r
99   /**\r
100    * \r
101    * \r
102    * @param index\r
103    * @param vProperty\r
104    * @throws java.lang.IndexOutOfBoundsException\r
105    *           if the index given is outside the bounds of the collection\r
106    */\r
107   public void addProperty(final int index,\r
108       final uk.ac.vamsas.objects.core.Property vProperty)\r
109       throws java.lang.IndexOutOfBoundsException {\r
110     this._propertyList.add(index, vProperty);\r
111   }\r
112 \r
113   /**\r
114    * \r
115    * \r
116    * @param vVref\r
117    * @throws java.lang.IndexOutOfBoundsException\r
118    *           if the index given is outside the bounds of the collection\r
119    */\r
120   public void addVref(final uk.ac.vamsas.objects.core.Vref vVref)\r
121       throws java.lang.IndexOutOfBoundsException {\r
122     this._vrefList.addElement(vVref);\r
123   }\r
124 \r
125   /**\r
126    * \r
127    * \r
128    * @param index\r
129    * @param vVref\r
130    * @throws java.lang.IndexOutOfBoundsException\r
131    *           if the index given is outside the bounds of the collection\r
132    */\r
133   public void addVref(final int index,\r
134       final uk.ac.vamsas.objects.core.Vref vVref)\r
135       throws java.lang.IndexOutOfBoundsException {\r
136     this._vrefList.add(index, vVref);\r
137   }\r
138 \r
139   /**\r
140    * Method enumerateProperty.\r
141    * \r
142    * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements\r
143    */\r
144   public java.util.Enumeration enumerateProperty() {\r
145     return this._propertyList.elements();\r
146   }\r
147 \r
148   /**\r
149    * Method enumerateVref.\r
150    * \r
151    * @return an Enumeration over all uk.ac.vamsas.objects.core.Vref elements\r
152    */\r
153   public java.util.Enumeration enumerateVref() {\r
154     return this._vrefList.elements();\r
155   }\r
156 \r
157   /**\r
158    * Overrides the java.lang.Object.equals method.\r
159    * \r
160    * @param obj\r
161    * @return true if the objects are equal.\r
162    */\r
163   public boolean equals(final java.lang.Object obj) {\r
164     if (this == obj)\r
165       return true;\r
166 \r
167     if (super.equals(obj) == false)\r
168       return false;\r
169 \r
170     if (obj instanceof NodeType) {\r
171 \r
172       NodeType temp = (NodeType) obj;\r
173       boolean thcycle;\r
174       boolean tmcycle;\r
175       if (this._id != null) {\r
176         if (temp._id == null)\r
177           return false;\r
178         if (this._id != temp._id) {\r
179           thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);\r
180           tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);\r
181           if (thcycle != tmcycle) {\r
182             if (!thcycle) {\r
183               org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
184             }\r
185             ;\r
186             if (!tmcycle) {\r
187               org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
188             }\r
189             ;\r
190             return false;\r
191           }\r
192           if (!thcycle) {\r
193             if (!this._id.equals(temp._id)) {\r
194               org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
195               org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
196               return false;\r
197             }\r
198             org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
199             org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
200           }\r
201         }\r
202       } else if (temp._id != null)\r
203         return false;\r
204       if (this._modifiable != null) {\r
205         if (temp._modifiable == null)\r
206           return false;\r
207         if (this._modifiable != temp._modifiable) {\r
208           thcycle = org.castor.util.CycleBreaker\r
209               .startingToCycle(this._modifiable);\r
210           tmcycle = org.castor.util.CycleBreaker\r
211               .startingToCycle(temp._modifiable);\r
212           if (thcycle != tmcycle) {\r
213             if (!thcycle) {\r
214               org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);\r
215             }\r
216             ;\r
217             if (!tmcycle) {\r
218               org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);\r
219             }\r
220             ;\r
221             return false;\r
222           }\r
223           if (!thcycle) {\r
224             if (!this._modifiable.equals(temp._modifiable)) {\r
225               org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);\r
226               org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);\r
227               return false;\r
228             }\r
229             org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);\r
230             org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);\r
231           }\r
232         }\r
233       } else if (temp._modifiable != null)\r
234         return false;\r
235       if (this._name != null) {\r
236         if (temp._name == null)\r
237           return false;\r
238         if (this._name != temp._name) {\r
239           thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);\r
240           tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);\r
241           if (thcycle != tmcycle) {\r
242             if (!thcycle) {\r
243               org.castor.util.CycleBreaker.releaseCycleHandle(this._name);\r
244             }\r
245             ;\r
246             if (!tmcycle) {\r
247               org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);\r
248             }\r
249             ;\r
250             return false;\r
251           }\r
252           if (!thcycle) {\r
253             if (!this._name.equals(temp._name)) {\r
254               org.castor.util.CycleBreaker.releaseCycleHandle(this._name);\r
255               org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);\r
256               return false;\r
257             }\r
258             org.castor.util.CycleBreaker.releaseCycleHandle(this._name);\r
259             org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);\r
260           }\r
261         }\r
262       } else if (temp._name != null)\r
263         return false;\r
264       if (this._description != null) {\r
265         if (temp._description == null)\r
266           return false;\r
267         if (this._description != temp._description) {\r
268           thcycle = org.castor.util.CycleBreaker\r
269               .startingToCycle(this._description);\r
270           tmcycle = org.castor.util.CycleBreaker\r
271               .startingToCycle(temp._description);\r
272           if (thcycle != tmcycle) {\r
273             if (!thcycle) {\r
274               org.castor.util.CycleBreaker\r
275                   .releaseCycleHandle(this._description);\r
276             }\r
277             ;\r
278             if (!tmcycle) {\r
279               org.castor.util.CycleBreaker\r
280                   .releaseCycleHandle(temp._description);\r
281             }\r
282             ;\r
283             return false;\r
284           }\r
285           if (!thcycle) {\r
286             if (!this._description.equals(temp._description)) {\r
287               org.castor.util.CycleBreaker\r
288                   .releaseCycleHandle(this._description);\r
289               org.castor.util.CycleBreaker\r
290                   .releaseCycleHandle(temp._description);\r
291               return false;\r
292             }\r
293             org.castor.util.CycleBreaker.releaseCycleHandle(this._description);\r
294             org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);\r
295           }\r
296         }\r
297       } else if (temp._description != null)\r
298         return false;\r
299       if (this._vrefList != null) {\r
300         if (temp._vrefList == null)\r
301           return false;\r
302         if (this._vrefList != temp._vrefList) {\r
303           thcycle = org.castor.util.CycleBreaker\r
304               .startingToCycle(this._vrefList);\r
305           tmcycle = org.castor.util.CycleBreaker\r
306               .startingToCycle(temp._vrefList);\r
307           if (thcycle != tmcycle) {\r
308             if (!thcycle) {\r
309               org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);\r
310             }\r
311             ;\r
312             if (!tmcycle) {\r
313               org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);\r
314             }\r
315             ;\r
316             return false;\r
317           }\r
318           if (!thcycle) {\r
319             if (!this._vrefList.equals(temp._vrefList)) {\r
320               org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);\r
321               org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);\r
322               return false;\r
323             }\r
324             org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);\r
325             org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);\r
326           }\r
327         }\r
328       } else if (temp._vrefList != null)\r
329         return false;\r
330       if (this._propertyList != null) {\r
331         if (temp._propertyList == null)\r
332           return false;\r
333         if (this._propertyList != temp._propertyList) {\r
334           thcycle = org.castor.util.CycleBreaker\r
335               .startingToCycle(this._propertyList);\r
336           tmcycle = org.castor.util.CycleBreaker\r
337               .startingToCycle(temp._propertyList);\r
338           if (thcycle != tmcycle) {\r
339             if (!thcycle) {\r
340               org.castor.util.CycleBreaker\r
341                   .releaseCycleHandle(this._propertyList);\r
342             }\r
343             ;\r
344             if (!tmcycle) {\r
345               org.castor.util.CycleBreaker\r
346                   .releaseCycleHandle(temp._propertyList);\r
347             }\r
348             ;\r
349             return false;\r
350           }\r
351           if (!thcycle) {\r
352             if (!this._propertyList.equals(temp._propertyList)) {\r
353               org.castor.util.CycleBreaker\r
354                   .releaseCycleHandle(this._propertyList);\r
355               org.castor.util.CycleBreaker\r
356                   .releaseCycleHandle(temp._propertyList);\r
357               return false;\r
358             }\r
359             org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);\r
360             org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);\r
361           }\r
362         }\r
363       } else if (temp._propertyList != null)\r
364         return false;\r
365       return true;\r
366     }\r
367     return false;\r
368   }\r
369 \r
370   /**\r
371    * Returns the value of field 'description'. The field 'description' has the\r
372    * following description: Descriptive text for this node\r
373    * \r
374    * @return the value of field 'Description'.\r
375    */\r
376   public java.lang.String getDescription() {\r
377     return this._description;\r
378   }\r
379 \r
380   /**\r
381    * Returns the value of field 'id'. The field 'id' has the following\r
382    * description: Primary Key for vamsas object referencing\r
383    * \r
384    * @return the value of field 'Id'.\r
385    */\r
386   public java.lang.String getId() {\r
387     return this._id;\r
388   }\r
389 \r
390   /**\r
391    * Returns the value of field 'modifiable'.\r
392    * \r
393    * @return the value of field 'Modifiable'.\r
394    */\r
395   public java.lang.String getModifiable() {\r
396     return this._modifiable;\r
397   }\r
398 \r
399   /**\r
400    * Returns the value of field 'name'. The field 'name' has the following\r
401    * description: Short name for this node\r
402    * \r
403    * @return the value of field 'Name'.\r
404    */\r
405   public java.lang.String getName() {\r
406     return this._name;\r
407   }\r
408 \r
409   /**\r
410    * Method getProperty.\r
411    * \r
412    * @param index\r
413    * @throws java.lang.IndexOutOfBoundsException\r
414    *           if the index given is outside the bounds of the collection\r
415    * @return the value of the uk.ac.vamsas.objects.core.Property at the given\r
416    *         index\r
417    */\r
418   public uk.ac.vamsas.objects.core.Property getProperty(final int index)\r
419       throws java.lang.IndexOutOfBoundsException {\r
420     // check bounds for index\r
421     if (index < 0 || index >= this._propertyList.size()) {\r
422       throw new IndexOutOfBoundsException("getProperty: Index value '" + index\r
423           + "' not in range [0.." + (this._propertyList.size() - 1) + "]");\r
424     }\r
425 \r
426     return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);\r
427   }\r
428 \r
429   /**\r
430    * Method getProperty.Returns the contents of the collection in an Array.\r
431    * <p>\r
432    * Note: Just in case the collection contents are changing in another thread,\r
433    * we pass a 0-length Array of the correct type into the API call. This way we\r
434    * <i>know</i> that the Array returned is of exactly the correct length.\r
435    * \r
436    * @return this collection as an Array\r
437    */\r
438   public uk.ac.vamsas.objects.core.Property[] getProperty() {\r
439     uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];\r
440     return (uk.ac.vamsas.objects.core.Property[]) this._propertyList\r
441         .toArray(array);\r
442   }\r
443 \r
444   /**\r
445    * Method getPropertyAsReference.Returns a reference to '_propertyList'. No\r
446    * type checking is performed on any modifications to the Vector.\r
447    * \r
448    * @return a reference to the Vector backing this class\r
449    */\r
450   public java.util.Vector getPropertyAsReference() {\r
451     return this._propertyList;\r
452   }\r
453 \r
454   /**\r
455    * Method getPropertyCount.\r
456    * \r
457    * @return the size of this collection\r
458    */\r
459   public int getPropertyCount() {\r
460     return this._propertyList.size();\r
461   }\r
462 \r
463   /**\r
464    * Method getVref.\r
465    * \r
466    * @param index\r
467    * @throws java.lang.IndexOutOfBoundsException\r
468    *           if the index given is outside the bounds of the collection\r
469    * @return the value of the uk.ac.vamsas.objects.core.Vref at the given index\r
470    */\r
471   public uk.ac.vamsas.objects.core.Vref getVref(final int index)\r
472       throws java.lang.IndexOutOfBoundsException {\r
473     // check bounds for index\r
474     if (index < 0 || index >= this._vrefList.size()) {\r
475       throw new IndexOutOfBoundsException("getVref: Index value '" + index\r
476           + "' not in range [0.." + (this._vrefList.size() - 1) + "]");\r
477     }\r
478 \r
479     return (uk.ac.vamsas.objects.core.Vref) _vrefList.get(index);\r
480   }\r
481 \r
482   /**\r
483    * Method getVref.Returns the contents of the collection in an Array.\r
484    * <p>\r
485    * Note: Just in case the collection contents are changing in another thread,\r
486    * we pass a 0-length Array of the correct type into the API call. This way we\r
487    * <i>know</i> that the Array returned is of exactly the correct length.\r
488    * \r
489    * @return this collection as an Array\r
490    */\r
491   public uk.ac.vamsas.objects.core.Vref[] getVref() {\r
492     uk.ac.vamsas.objects.core.Vref[] array = new uk.ac.vamsas.objects.core.Vref[0];\r
493     return (uk.ac.vamsas.objects.core.Vref[]) this._vrefList.toArray(array);\r
494   }\r
495 \r
496   /**\r
497    * Method getVrefAsReference.Returns a reference to '_vrefList'. No type\r
498    * checking is performed on any modifications to the Vector.\r
499    * \r
500    * @return a reference to the Vector backing this class\r
501    */\r
502   public java.util.Vector getVrefAsReference() {\r
503     return this._vrefList;\r
504   }\r
505 \r
506   /**\r
507    * Method getVrefCount.\r
508    * \r
509    * @return the size of this collection\r
510    */\r
511   public int getVrefCount() {\r
512     return this._vrefList.size();\r
513   }\r
514 \r
515   /**\r
516    * Overrides the java.lang.Object.hashCode method.\r
517    * <p>\r
518    * The following steps came from <b>Effective Java Programming Language\r
519    * Guide</b> by Joshua Bloch, Chapter 3\r
520    * \r
521    * @return a hash code value for the object.\r
522    */\r
523   public int hashCode() {\r
524     int result = super.hashCode();\r
525 \r
526     long tmp;\r
527     if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {\r
528       result = 37 * result + _id.hashCode();\r
529       org.castor.util.CycleBreaker.releaseCycleHandle(_id);\r
530     }\r
531     if (_modifiable != null\r
532         && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {\r
533       result = 37 * result + _modifiable.hashCode();\r
534       org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);\r
535     }\r
536     if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {\r
537       result = 37 * result + _name.hashCode();\r
538       org.castor.util.CycleBreaker.releaseCycleHandle(_name);\r
539     }\r
540     if (_description != null\r
541         && !org.castor.util.CycleBreaker.startingToCycle(_description)) {\r
542       result = 37 * result + _description.hashCode();\r
543       org.castor.util.CycleBreaker.releaseCycleHandle(_description);\r
544     }\r
545     if (_vrefList != null\r
546         && !org.castor.util.CycleBreaker.startingToCycle(_vrefList)) {\r
547       result = 37 * result + _vrefList.hashCode();\r
548       org.castor.util.CycleBreaker.releaseCycleHandle(_vrefList);\r
549     }\r
550     if (_propertyList != null\r
551         && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {\r
552       result = 37 * result + _propertyList.hashCode();\r
553       org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);\r
554     }\r
555 \r
556     return result;\r
557   }\r
558 \r
559   /**\r
560    * Method isValid.\r
561    * \r
562    * @return true if this object is valid according to the schema\r
563    */\r
564   public boolean isValid() {\r
565     try {\r
566       validate();\r
567     } catch (org.exolab.castor.xml.ValidationException vex) {\r
568       return false;\r
569     }\r
570     return true;\r
571   }\r
572 \r
573   /**\r
574    * \r
575    * \r
576    * @param out\r
577    * @throws org.exolab.castor.xml.MarshalException\r
578    *           if object is null or if any SAXException is thrown during\r
579    *           marshaling\r
580    * @throws org.exolab.castor.xml.ValidationException\r
581    *           if this object is an invalid instance according to the schema\r
582    */\r
583   public void marshal(final java.io.Writer out)\r
584       throws org.exolab.castor.xml.MarshalException,\r
585       org.exolab.castor.xml.ValidationException {\r
586     Marshaller.marshal(this, out);\r
587   }\r
588 \r
589   /**\r
590    * \r
591    * \r
592    * @param handler\r
593    * @throws java.io.IOException\r
594    *           if an IOException occurs during marshaling\r
595    * @throws org.exolab.castor.xml.ValidationException\r
596    *           if this object is an invalid instance according to the schema\r
597    * @throws org.exolab.castor.xml.MarshalException\r
598    *           if object is null or if any SAXException is thrown during\r
599    *           marshaling\r
600    */\r
601   public void marshal(final org.xml.sax.ContentHandler handler)\r
602       throws java.io.IOException, org.exolab.castor.xml.MarshalException,\r
603       org.exolab.castor.xml.ValidationException {\r
604     Marshaller.marshal(this, handler);\r
605   }\r
606 \r
607   /**\r
608      */\r
609   public void removeAllProperty() {\r
610     this._propertyList.clear();\r
611   }\r
612 \r
613   /**\r
614      */\r
615   public void removeAllVref() {\r
616     this._vrefList.clear();\r
617   }\r
618 \r
619   /**\r
620    * Method removeProperty.\r
621    * \r
622    * @param vProperty\r
623    * @return true if the object was removed from the collection.\r
624    */\r
625   public boolean removeProperty(\r
626       final uk.ac.vamsas.objects.core.Property vProperty) {\r
627     boolean removed = _propertyList.remove(vProperty);\r
628     return removed;\r
629   }\r
630 \r
631   /**\r
632    * Method removePropertyAt.\r
633    * \r
634    * @param index\r
635    * @return the element removed from the collection\r
636    */\r
637   public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {\r
638     java.lang.Object obj = this._propertyList.remove(index);\r
639     return (uk.ac.vamsas.objects.core.Property) obj;\r
640   }\r
641 \r
642   /**\r
643    * Method removeVref.\r
644    * \r
645    * @param vVref\r
646    * @return true if the object was removed from the collection.\r
647    */\r
648   public boolean removeVref(final uk.ac.vamsas.objects.core.Vref vVref) {\r
649     boolean removed = _vrefList.remove(vVref);\r
650     return removed;\r
651   }\r
652 \r
653   /**\r
654    * Method removeVrefAt.\r
655    * \r
656    * @param index\r
657    * @return the element removed from the collection\r
658    */\r
659   public uk.ac.vamsas.objects.core.Vref removeVrefAt(final int index) {\r
660     java.lang.Object obj = this._vrefList.remove(index);\r
661     return (uk.ac.vamsas.objects.core.Vref) obj;\r
662   }\r
663 \r
664   /**\r
665    * Sets the value of field 'description'. The field 'description' has the\r
666    * following description: Descriptive text for this node\r
667    * \r
668    * @param description\r
669    *          the value of field 'description'.\r
670    */\r
671   public void setDescription(final java.lang.String description) {\r
672     this._description = description;\r
673   }\r
674 \r
675   /**\r
676    * Sets the value of field 'id'. The field 'id' has the following description:\r
677    * Primary Key for vamsas object referencing\r
678    * \r
679    * @param id\r
680    *          the value of field 'id'.\r
681    */\r
682   public void setId(final java.lang.String id) {\r
683     this._id = id;\r
684   }\r
685 \r
686   /**\r
687    * Sets the value of field 'modifiable'.\r
688    * \r
689    * @param modifiable\r
690    *          the value of field 'modifiable'.\r
691    */\r
692   public void setModifiable(final java.lang.String modifiable) {\r
693     this._modifiable = modifiable;\r
694   }\r
695 \r
696   /**\r
697    * Sets the value of field 'name'. The field 'name' has the following\r
698    * description: Short name for this node\r
699    * \r
700    * @param name\r
701    *          the value of field 'name'.\r
702    */\r
703   public void setName(final java.lang.String name) {\r
704     this._name = name;\r
705   }\r
706 \r
707   /**\r
708    * \r
709    * \r
710    * @param index\r
711    * @param vProperty\r
712    * @throws java.lang.IndexOutOfBoundsException\r
713    *           if the index given is outside the bounds of the collection\r
714    */\r
715   public void setProperty(final int index,\r
716       final uk.ac.vamsas.objects.core.Property vProperty)\r
717       throws java.lang.IndexOutOfBoundsException {\r
718     // check bounds for index\r
719     if (index < 0 || index >= this._propertyList.size()) {\r
720       throw new IndexOutOfBoundsException("setProperty: Index value '" + index\r
721           + "' not in range [0.." + (this._propertyList.size() - 1) + "]");\r
722     }\r
723 \r
724     this._propertyList.set(index, vProperty);\r
725   }\r
726 \r
727   /**\r
728    * \r
729    * \r
730    * @param vPropertyArray\r
731    */\r
732   public void setProperty(\r
733       final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {\r
734     // -- copy array\r
735     _propertyList.clear();\r
736 \r
737     for (int i = 0; i < vPropertyArray.length; i++) {\r
738       this._propertyList.add(vPropertyArray[i]);\r
739     }\r
740   }\r
741 \r
742   /**\r
743    * Sets the value of '_propertyList' by copying the given Vector. All elements\r
744    * will be checked for type safety.\r
745    * \r
746    * @param vPropertyList\r
747    *          the Vector to copy.\r
748    */\r
749   public void setProperty(final java.util.Vector vPropertyList) {\r
750     // copy vector\r
751     this._propertyList.clear();\r
752 \r
753     this._propertyList.addAll(vPropertyList);\r
754   }\r
755 \r
756   /**\r
757    * Sets the value of '_propertyList' by setting it to the given Vector. No\r
758    * type checking is performed.\r
759    * \r
760    * @deprecated\r
761    * \r
762    * @param propertyVector\r
763    *          the Vector to set.\r
764    */\r
765   public void setPropertyAsReference(final java.util.Vector propertyVector) {\r
766     this._propertyList = propertyVector;\r
767   }\r
768 \r
769   /**\r
770    * \r
771    * \r
772    * @param index\r
773    * @param vVref\r
774    * @throws java.lang.IndexOutOfBoundsException\r
775    *           if the index given is outside the bounds of the collection\r
776    */\r
777   public void setVref(final int index,\r
778       final uk.ac.vamsas.objects.core.Vref vVref)\r
779       throws java.lang.IndexOutOfBoundsException {\r
780     // check bounds for index\r
781     if (index < 0 || index >= this._vrefList.size()) {\r
782       throw new IndexOutOfBoundsException("setVref: Index value '" + index\r
783           + "' not in range [0.." + (this._vrefList.size() - 1) + "]");\r
784     }\r
785 \r
786     this._vrefList.set(index, vVref);\r
787   }\r
788 \r
789   /**\r
790    * \r
791    * \r
792    * @param vVrefArray\r
793    */\r
794   public void setVref(final uk.ac.vamsas.objects.core.Vref[] vVrefArray) {\r
795     // -- copy array\r
796     _vrefList.clear();\r
797 \r
798     for (int i = 0; i < vVrefArray.length; i++) {\r
799       this._vrefList.add(vVrefArray[i]);\r
800     }\r
801   }\r
802 \r
803   /**\r
804    * Sets the value of '_vrefList' by copying the given Vector. All elements\r
805    * will be checked for type safety.\r
806    * \r
807    * @param vVrefList\r
808    *          the Vector to copy.\r
809    */\r
810   public void setVref(final java.util.Vector vVrefList) {\r
811     // copy vector\r
812     this._vrefList.clear();\r
813 \r
814     this._vrefList.addAll(vVrefList);\r
815   }\r
816 \r
817   /**\r
818    * Sets the value of '_vrefList' by setting it to the given Vector. No type\r
819    * checking is performed.\r
820    * \r
821    * @deprecated\r
822    * \r
823    * @param vrefVector\r
824    *          the Vector to set.\r
825    */\r
826   public void setVrefAsReference(final java.util.Vector vrefVector) {\r
827     this._vrefList = vrefVector;\r
828   }\r
829 \r
830   /**\r
831    * Method unmarshal.\r
832    * \r
833    * @param reader\r
834    * @throws org.exolab.castor.xml.MarshalException\r
835    *           if object is null or if any SAXException is thrown during\r
836    *           marshaling\r
837    * @throws org.exolab.castor.xml.ValidationException\r
838    *           if this object is an invalid instance according to the schema\r
839    * @return the unmarshaled uk.ac.vamsas.objects.core.NodeType\r
840    */\r
841   public static uk.ac.vamsas.objects.core.NodeType unmarshal(\r
842       final java.io.Reader reader)\r
843       throws org.exolab.castor.xml.MarshalException,\r
844       org.exolab.castor.xml.ValidationException {\r
845     return (uk.ac.vamsas.objects.core.NodeType) Unmarshaller.unmarshal(\r
846         uk.ac.vamsas.objects.core.NodeType.class, reader);\r
847   }\r
848 \r
849   /**\r
850    * \r
851    * \r
852    * @throws org.exolab.castor.xml.ValidationException\r
853    *           if this object is an invalid instance according to the schema\r
854    */\r
855   public void validate() throws org.exolab.castor.xml.ValidationException {\r
856     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
857     validator.validate(this);\r
858   }\r
859 \r
860 }\r