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