cyclic IDREF patched castor-1.1.1 source
[vamsas.git] / src / uk / ac / vamsas / objects / core / RangeAnnotation.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  * Annotation for a rangeSpec - values can be attached for the\r
19  * whole\r
20  *  specification, and to each position within the spec. following\r
21  * the orientation\r
22  *  specified by the ordered set of rangeSpec (pos, seg) elements. \r
23  * \r
24  * @version $Revision$ $Date$\r
25  */\r
26 public class RangeAnnotation extends uk.ac.vamsas.objects.core.RangeType \r
27 implements java.io.Serializable\r
28 {\r
29 \r
30 \r
31       //--------------------------/\r
32      //- Class/Member Variables -/\r
33     //--------------------------/\r
34 \r
35     /**\r
36      * Primary Key for vamsas object referencing\r
37      *  \r
38      */\r
39     private java.lang.String _id;\r
40 \r
41     /**\r
42      * Field _modifiable.\r
43      */\r
44     private java.lang.String _modifiable;\r
45 \r
46     /**\r
47      * Annotation with the same non-empty group name are grouped\r
48      *  together \r
49      */\r
50     private java.lang.String _group = "";\r
51 \r
52     /**\r
53      * A Das Feature has both a type and a Type ID. We go the\r
54      *  route of requiring the type string to be taken from a\r
55      * controlled\r
56      *  vocabulary if an application expects others to make sense\r
57      * of it. The\r
58      *  type may qualified - so uniprot:CHAIN is a valid type name,\r
59      * and\r
60      *  considered distinct from someotherDB:CHAIN \r
61      */\r
62     private java.lang.String _type;\r
63 \r
64     /**\r
65      * Short, meaningful name for the annotation - if this\r
66      *  is absent, then the type string should be used in its\r
67      * place.\r
68      *  \r
69      */\r
70     private java.lang.String _label;\r
71 \r
72     /**\r
73      * Human readable description of the annotation\r
74      *  \r
75      */\r
76     private java.lang.String _description;\r
77 \r
78     /**\r
79      * TODO: specify this - we have considered taking the GO\r
80      *  evidence codes as a model for assessing a measure of\r
81      * quality to an\r
82      *  annotation. \r
83      */\r
84     private java.lang.String _status;\r
85 \r
86     /**\r
87      * Annotation Element position maps to ordered positions\r
88      *  defined by the sequence of rangeType pos positions or\r
89      * concatenated\r
90      *  seg start/end segments. \r
91      */\r
92     private java.util.Vector _annotationElementList;\r
93 \r
94     /**\r
95      * Ordered set of optionally named float values for the\r
96      *  whole annotation \r
97      */\r
98     private java.util.Vector _scoreList;\r
99 \r
100     /**\r
101      * Field _linkList.\r
102      */\r
103     private java.util.Vector _linkList;\r
104 \r
105     /**\r
106      * Note:These are mutable so an application should check\r
107      *  them each time. \r
108      */\r
109     private java.util.Vector _propertyList;\r
110 \r
111 \r
112       //----------------/\r
113      //- Constructors -/\r
114     //----------------/\r
115 \r
116     public RangeAnnotation() {\r
117         super();\r
118         setGroup("");\r
119         this._annotationElementList = new java.util.Vector();\r
120         this._scoreList = new java.util.Vector();\r
121         this._linkList = new java.util.Vector();\r
122         this._propertyList = new java.util.Vector();\r
123     }\r
124 \r
125 \r
126       //-----------/\r
127      //- Methods -/\r
128     //-----------/\r
129 \r
130     /**\r
131      * \r
132      * \r
133      * @param vAnnotationElement\r
134      * @throws java.lang.IndexOutOfBoundsException if the index\r
135      * given is outside the bounds of the collection\r
136      */\r
137     public void addAnnotationElement(\r
138             final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)\r
139     throws java.lang.IndexOutOfBoundsException {\r
140         this._annotationElementList.addElement(vAnnotationElement);\r
141     }\r
142 \r
143     /**\r
144      * \r
145      * \r
146      * @param index\r
147      * @param vAnnotationElement\r
148      * @throws java.lang.IndexOutOfBoundsException if the index\r
149      * given is outside the bounds of the collection\r
150      */\r
151     public void addAnnotationElement(\r
152             final int index,\r
153             final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)\r
154     throws java.lang.IndexOutOfBoundsException {\r
155         this._annotationElementList.add(index, vAnnotationElement);\r
156     }\r
157 \r
158     /**\r
159      * \r
160      * \r
161      * @param vLink\r
162      * @throws java.lang.IndexOutOfBoundsException if the index\r
163      * given is outside the bounds of the collection\r
164      */\r
165     public void addLink(\r
166             final uk.ac.vamsas.objects.core.Link vLink)\r
167     throws java.lang.IndexOutOfBoundsException {\r
168         this._linkList.addElement(vLink);\r
169     }\r
170 \r
171     /**\r
172      * \r
173      * \r
174      * @param index\r
175      * @param vLink\r
176      * @throws java.lang.IndexOutOfBoundsException if the index\r
177      * given is outside the bounds of the collection\r
178      */\r
179     public void addLink(\r
180             final int index,\r
181             final uk.ac.vamsas.objects.core.Link vLink)\r
182     throws java.lang.IndexOutOfBoundsException {\r
183         this._linkList.add(index, vLink);\r
184     }\r
185 \r
186     /**\r
187      * \r
188      * \r
189      * @param vProperty\r
190      * @throws java.lang.IndexOutOfBoundsException if the index\r
191      * given is outside the bounds of the collection\r
192      */\r
193     public void addProperty(\r
194             final uk.ac.vamsas.objects.core.Property vProperty)\r
195     throws java.lang.IndexOutOfBoundsException {\r
196         this._propertyList.addElement(vProperty);\r
197     }\r
198 \r
199     /**\r
200      * \r
201      * \r
202      * @param index\r
203      * @param vProperty\r
204      * @throws java.lang.IndexOutOfBoundsException if the index\r
205      * given is outside the bounds of the collection\r
206      */\r
207     public void addProperty(\r
208             final int index,\r
209             final uk.ac.vamsas.objects.core.Property vProperty)\r
210     throws java.lang.IndexOutOfBoundsException {\r
211         this._propertyList.add(index, vProperty);\r
212     }\r
213 \r
214     /**\r
215      * \r
216      * \r
217      * @param vScore\r
218      * @throws java.lang.IndexOutOfBoundsException if the index\r
219      * given is outside the bounds of the collection\r
220      */\r
221     public void addScore(\r
222             final uk.ac.vamsas.objects.core.Score vScore)\r
223     throws java.lang.IndexOutOfBoundsException {\r
224         this._scoreList.addElement(vScore);\r
225     }\r
226 \r
227     /**\r
228      * \r
229      * \r
230      * @param index\r
231      * @param vScore\r
232      * @throws java.lang.IndexOutOfBoundsException if the index\r
233      * given is outside the bounds of the collection\r
234      */\r
235     public void addScore(\r
236             final int index,\r
237             final uk.ac.vamsas.objects.core.Score vScore)\r
238     throws java.lang.IndexOutOfBoundsException {\r
239         this._scoreList.add(index, vScore);\r
240     }\r
241 \r
242     /**\r
243      * Method enumerateAnnotationElement.\r
244      * \r
245      * @return an Enumeration over all\r
246      * uk.ac.vamsas.objects.core.AnnotationElement elements\r
247      */\r
248     public java.util.Enumeration enumerateAnnotationElement(\r
249     ) {\r
250         return this._annotationElementList.elements();\r
251     }\r
252 \r
253     /**\r
254      * Method enumerateLink.\r
255      * \r
256      * @return an Enumeration over all\r
257      * uk.ac.vamsas.objects.core.Link elements\r
258      */\r
259     public java.util.Enumeration enumerateLink(\r
260     ) {\r
261         return this._linkList.elements();\r
262     }\r
263 \r
264     /**\r
265      * Method enumerateProperty.\r
266      * \r
267      * @return an Enumeration over all\r
268      * uk.ac.vamsas.objects.core.Property elements\r
269      */\r
270     public java.util.Enumeration enumerateProperty(\r
271     ) {\r
272         return this._propertyList.elements();\r
273     }\r
274 \r
275     /**\r
276      * Method enumerateScore.\r
277      * \r
278      * @return an Enumeration over all\r
279      * uk.ac.vamsas.objects.core.Score elements\r
280      */\r
281     public java.util.Enumeration enumerateScore(\r
282     ) {\r
283         return this._scoreList.elements();\r
284     }\r
285 \r
286     /**\r
287      * Overrides the java.lang.Object.equals method.\r
288      * \r
289      * @param obj\r
290      * @return true if the objects are equal.\r
291      */\r
292     public boolean equals(\r
293             final java.lang.Object obj) {\r
294         if ( this == obj )\r
295             return true;\r
296         \r
297         if (super.equals(obj)==false)\r
298             return false;\r
299         \r
300         if (obj instanceof RangeAnnotation) {\r
301         \r
302             RangeAnnotation temp = (RangeAnnotation)obj;\r
303             if (this._id != null) {\r
304                 if (temp._id == null) return false;\r
305                 else if (!(this._id.equals(temp._id))) \r
306                     return false;\r
307             }\r
308             else if (temp._id != null)\r
309                 return false;\r
310             if (this._modifiable != null) {\r
311                 if (temp._modifiable == null) return false;\r
312                 else if (!(this._modifiable.equals(temp._modifiable))) \r
313                     return false;\r
314             }\r
315             else if (temp._modifiable != null)\r
316                 return false;\r
317             if (this._group != null) {\r
318                 if (temp._group == null) return false;\r
319                 else if (!(this._group.equals(temp._group))) \r
320                     return false;\r
321             }\r
322             else if (temp._group != null)\r
323                 return false;\r
324             if (this._type != null) {\r
325                 if (temp._type == null) return false;\r
326                 else if (!(this._type.equals(temp._type))) \r
327                     return false;\r
328             }\r
329             else if (temp._type != null)\r
330                 return false;\r
331             if (this._label != null) {\r
332                 if (temp._label == null) return false;\r
333                 else if (!(this._label.equals(temp._label))) \r
334                     return false;\r
335             }\r
336             else if (temp._label != null)\r
337                 return false;\r
338             if (this._description != null) {\r
339                 if (temp._description == null) return false;\r
340                 else if (!(this._description.equals(temp._description))) \r
341                     return false;\r
342             }\r
343             else if (temp._description != null)\r
344                 return false;\r
345             if (this._status != null) {\r
346                 if (temp._status == null) return false;\r
347                 else if (!(this._status.equals(temp._status))) \r
348                     return false;\r
349             }\r
350             else if (temp._status != null)\r
351                 return false;\r
352             if (this._annotationElementList != null) {\r
353                 if (temp._annotationElementList == null) return false;\r
354                 else if (!(this._annotationElementList.equals(temp._annotationElementList))) \r
355                     return false;\r
356             }\r
357             else if (temp._annotationElementList != null)\r
358                 return false;\r
359             if (this._scoreList != null) {\r
360                 if (temp._scoreList == null) return false;\r
361                 else if (!(this._scoreList.equals(temp._scoreList))) \r
362                     return false;\r
363             }\r
364             else if (temp._scoreList != null)\r
365                 return false;\r
366             if (this._linkList != null) {\r
367                 if (temp._linkList == null) return false;\r
368                 else if (!(this._linkList.equals(temp._linkList))) \r
369                     return false;\r
370             }\r
371             else if (temp._linkList != null)\r
372                 return false;\r
373             if (this._propertyList != null) {\r
374                 if (temp._propertyList == null) return false;\r
375                 else if (!(this._propertyList.equals(temp._propertyList))) \r
376                     return false;\r
377             }\r
378             else if (temp._propertyList != null)\r
379                 return false;\r
380             return true;\r
381         }\r
382         return false;\r
383     }\r
384 \r
385     /**\r
386      * Method getAnnotationElement.\r
387      * \r
388      * @param index\r
389      * @throws java.lang.IndexOutOfBoundsException if the index\r
390      * given is outside the bounds of the collection\r
391      * @return the value of the\r
392      * uk.ac.vamsas.objects.core.AnnotationElement at the given inde\r
393      */\r
394     public uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(\r
395             final int index)\r
396     throws java.lang.IndexOutOfBoundsException {\r
397         // check bounds for index\r
398         if (index < 0 || index >= this._annotationElementList.size()) {\r
399             throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");\r
400         }\r
401         \r
402         return (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.get(index);\r
403     }\r
404 \r
405     /**\r
406      * Method getAnnotationElement.Returns the contents of the\r
407      * collection in an Array.  <p>Note:  Just in case the\r
408      * collection contents are changing in another thread, we pass\r
409      * a 0-length Array of the correct type into the API call. \r
410      * This way we <i>know</i> that the Array returned is of\r
411      * exactly the correct length.\r
412      * \r
413      * @return this collection as an Array\r
414      */\r
415     public uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement(\r
416     ) {\r
417         uk.ac.vamsas.objects.core.AnnotationElement[] array = new uk.ac.vamsas.objects.core.AnnotationElement[0];\r
418         return (uk.ac.vamsas.objects.core.AnnotationElement[]) this._annotationElementList.toArray(array);\r
419     }\r
420 \r
421     /**\r
422      * Method getAnnotationElementAsReference.Returns a reference\r
423      * to '_annotationElementList'. No type checking is performed\r
424      * on any modifications to the Vector.\r
425      * \r
426      * @return a reference to the Vector backing this class\r
427      */\r
428     public java.util.Vector getAnnotationElementAsReference(\r
429     ) {\r
430         return this._annotationElementList;\r
431     }\r
432 \r
433     /**\r
434      * Method getAnnotationElementCount.\r
435      * \r
436      * @return the size of this collection\r
437      */\r
438     public int getAnnotationElementCount(\r
439     ) {\r
440         return this._annotationElementList.size();\r
441     }\r
442 \r
443     /**\r
444      * Returns the value of field 'description'. The field\r
445      * 'description' has the following description: Human readable\r
446      * description of the annotation\r
447      *  \r
448      * \r
449      * @return the value of field 'Description'.\r
450      */\r
451     public java.lang.String getDescription(\r
452     ) {\r
453         return this._description;\r
454     }\r
455 \r
456     /**\r
457      * Returns the value of field 'group'. The field 'group' has\r
458      * the following description: Annotation with the same\r
459      * non-empty group name are grouped\r
460      *  together \r
461      * \r
462      * @return the value of field 'Group'.\r
463      */\r
464     public java.lang.String getGroup(\r
465     ) {\r
466         return this._group;\r
467     }\r
468 \r
469     /**\r
470      * Returns the value of field 'id'. The field 'id' has the\r
471      * following description: Primary Key for vamsas object\r
472      * referencing\r
473      *  \r
474      * \r
475      * @return the value of field 'Id'.\r
476      */\r
477     public java.lang.String getId(\r
478     ) {\r
479         return this._id;\r
480     }\r
481 \r
482     /**\r
483      * Returns the value of field 'label'. The field 'label' has\r
484      * the following description: Short, meaningful name for the\r
485      * annotation - if this\r
486      *  is absent, then the type string should be used in its\r
487      * place.\r
488      *  \r
489      * \r
490      * @return the value of field 'Label'.\r
491      */\r
492     public java.lang.String getLabel(\r
493     ) {\r
494         return this._label;\r
495     }\r
496 \r
497     /**\r
498      * Method getLink.\r
499      * \r
500      * @param index\r
501      * @throws java.lang.IndexOutOfBoundsException if the index\r
502      * given is outside the bounds of the collection\r
503      * @return the value of the uk.ac.vamsas.objects.core.Link at\r
504      * the given index\r
505      */\r
506     public uk.ac.vamsas.objects.core.Link getLink(\r
507             final int index)\r
508     throws java.lang.IndexOutOfBoundsException {\r
509         // check bounds for index\r
510         if (index < 0 || index >= this._linkList.size()) {\r
511             throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");\r
512         }\r
513         \r
514         return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);\r
515     }\r
516 \r
517     /**\r
518      * Method getLink.Returns the contents of the collection in an\r
519      * Array.  <p>Note:  Just in case the collection contents are\r
520      * changing in another thread, we pass a 0-length Array of the\r
521      * correct type into the API call.  This way we <i>know</i>\r
522      * that the Array returned is of exactly the correct length.\r
523      * \r
524      * @return this collection as an Array\r
525      */\r
526     public uk.ac.vamsas.objects.core.Link[] getLink(\r
527     ) {\r
528         uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];\r
529         return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);\r
530     }\r
531 \r
532     /**\r
533      * Method getLinkAsReference.Returns a reference to\r
534      * '_linkList'. No type checking is performed on any\r
535      * modifications to the Vector.\r
536      * \r
537      * @return a reference to the Vector backing this class\r
538      */\r
539     public java.util.Vector getLinkAsReference(\r
540     ) {\r
541         return this._linkList;\r
542     }\r
543 \r
544     /**\r
545      * Method getLinkCount.\r
546      * \r
547      * @return the size of this collection\r
548      */\r
549     public int getLinkCount(\r
550     ) {\r
551         return this._linkList.size();\r
552     }\r
553 \r
554     /**\r
555      * Returns the value of field 'modifiable'.\r
556      * \r
557      * @return the value of field 'Modifiable'.\r
558      */\r
559     public java.lang.String getModifiable(\r
560     ) {\r
561         return this._modifiable;\r
562     }\r
563 \r
564     /**\r
565      * Method getProperty.\r
566      * \r
567      * @param index\r
568      * @throws java.lang.IndexOutOfBoundsException if the index\r
569      * given is outside the bounds of the collection\r
570      * @return the value of the uk.ac.vamsas.objects.core.Property\r
571      * at the given index\r
572      */\r
573     public uk.ac.vamsas.objects.core.Property getProperty(\r
574             final int index)\r
575     throws java.lang.IndexOutOfBoundsException {\r
576         // check bounds for index\r
577         if (index < 0 || index >= this._propertyList.size()) {\r
578             throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");\r
579         }\r
580         \r
581         return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);\r
582     }\r
583 \r
584     /**\r
585      * Method getProperty.Returns the contents of the collection in\r
586      * an Array.  <p>Note:  Just in case the collection contents\r
587      * are changing in another thread, we pass a 0-length Array of\r
588      * the correct type into the API call.  This way we <i>know</i>\r
589      * that the Array returned is of exactly the correct length.\r
590      * \r
591      * @return this collection as an Array\r
592      */\r
593     public uk.ac.vamsas.objects.core.Property[] getProperty(\r
594     ) {\r
595         uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];\r
596         return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);\r
597     }\r
598 \r
599     /**\r
600      * Method getPropertyAsReference.Returns a reference to\r
601      * '_propertyList'. No type checking is performed on any\r
602      * modifications to the Vector.\r
603      * \r
604      * @return a reference to the Vector backing this class\r
605      */\r
606     public java.util.Vector getPropertyAsReference(\r
607     ) {\r
608         return this._propertyList;\r
609     }\r
610 \r
611     /**\r
612      * Method getPropertyCount.\r
613      * \r
614      * @return the size of this collection\r
615      */\r
616     public int getPropertyCount(\r
617     ) {\r
618         return this._propertyList.size();\r
619     }\r
620 \r
621     /**\r
622      * Method getScore.\r
623      * \r
624      * @param index\r
625      * @throws java.lang.IndexOutOfBoundsException if the index\r
626      * given is outside the bounds of the collection\r
627      * @return the value of the uk.ac.vamsas.objects.core.Score at\r
628      * the given index\r
629      */\r
630     public uk.ac.vamsas.objects.core.Score getScore(\r
631             final int index)\r
632     throws java.lang.IndexOutOfBoundsException {\r
633         // check bounds for index\r
634         if (index < 0 || index >= this._scoreList.size()) {\r
635             throw new IndexOutOfBoundsException("getScore: Index value '" + index + "' not in range [0.." + (this._scoreList.size() - 1) + "]");\r
636         }\r
637         \r
638         return (uk.ac.vamsas.objects.core.Score) _scoreList.get(index);\r
639     }\r
640 \r
641     /**\r
642      * Method getScore.Returns the contents of the collection in an\r
643      * Array.  <p>Note:  Just in case the collection contents are\r
644      * changing in another thread, we pass a 0-length Array of the\r
645      * correct type into the API call.  This way we <i>know</i>\r
646      * that the Array returned is of exactly the correct length.\r
647      * \r
648      * @return this collection as an Array\r
649      */\r
650     public uk.ac.vamsas.objects.core.Score[] getScore(\r
651     ) {\r
652         uk.ac.vamsas.objects.core.Score[] array = new uk.ac.vamsas.objects.core.Score[0];\r
653         return (uk.ac.vamsas.objects.core.Score[]) this._scoreList.toArray(array);\r
654     }\r
655 \r
656     /**\r
657      * Method getScoreAsReference.Returns a reference to\r
658      * '_scoreList'. No type checking is performed on any\r
659      * modifications to the Vector.\r
660      * \r
661      * @return a reference to the Vector backing this class\r
662      */\r
663     public java.util.Vector getScoreAsReference(\r
664     ) {\r
665         return this._scoreList;\r
666     }\r
667 \r
668     /**\r
669      * Method getScoreCount.\r
670      * \r
671      * @return the size of this collection\r
672      */\r
673     public int getScoreCount(\r
674     ) {\r
675         return this._scoreList.size();\r
676     }\r
677 \r
678     /**\r
679      * Returns the value of field 'status'. The field 'status' has\r
680      * the following description: TODO: specify this - we have\r
681      * considered taking the GO\r
682      *  evidence codes as a model for assessing a measure of\r
683      * quality to an\r
684      *  annotation. \r
685      * \r
686      * @return the value of field 'Status'.\r
687      */\r
688     public java.lang.String getStatus(\r
689     ) {\r
690         return this._status;\r
691     }\r
692 \r
693     /**\r
694      * Returns the value of field 'type'. The field 'type' has the\r
695      * following description: A Das Feature has both a type and a\r
696      * Type ID. We go the\r
697      *  route of requiring the type string to be taken from a\r
698      * controlled\r
699      *  vocabulary if an application expects others to make sense\r
700      * of it. The\r
701      *  type may qualified - so uniprot:CHAIN is a valid type name,\r
702      * and\r
703      *  considered distinct from someotherDB:CHAIN \r
704      * \r
705      * @return the value of field 'Type'.\r
706      */\r
707     public java.lang.String getType(\r
708     ) {\r
709         return this._type;\r
710     }\r
711 \r
712     /**\r
713      * Overrides the java.lang.Object.hashCode method.\r
714      * <p>\r
715      * The following steps came from <b>Effective Java Programming\r
716      * Language Guide</b> by Joshua Bloch, Chapter 3\r
717      * \r
718      * @return a hash code value for the object.\r
719      */\r
720     public int hashCode(\r
721     ) {\r
722         int result = super.hashCode();\r
723         \r
724         long tmp;\r
725         if (_id != null) {\r
726            result = 37 * result + _id.hashCode();\r
727         }\r
728         if (_modifiable != null) {\r
729            result = 37 * result + _modifiable.hashCode();\r
730         }\r
731         if (_group != null) {\r
732            result = 37 * result + _group.hashCode();\r
733         }\r
734         if (_type != null) {\r
735            result = 37 * result + _type.hashCode();\r
736         }\r
737         if (_label != null) {\r
738            result = 37 * result + _label.hashCode();\r
739         }\r
740         if (_description != null) {\r
741            result = 37 * result + _description.hashCode();\r
742         }\r
743         if (_status != null) {\r
744            result = 37 * result + _status.hashCode();\r
745         }\r
746         if (_annotationElementList != null) {\r
747            result = 37 * result + _annotationElementList.hashCode();\r
748         }\r
749         if (_scoreList != null) {\r
750            result = 37 * result + _scoreList.hashCode();\r
751         }\r
752         if (_linkList != null) {\r
753            result = 37 * result + _linkList.hashCode();\r
754         }\r
755         if (_propertyList != null) {\r
756            result = 37 * result + _propertyList.hashCode();\r
757         }\r
758         \r
759         return result;\r
760     }\r
761 \r
762     /**\r
763      * Method isValid.\r
764      * \r
765      * @return true if this object is valid according to the schema\r
766      */\r
767     public boolean isValid(\r
768     ) {\r
769         try {\r
770             validate();\r
771         } catch (org.exolab.castor.xml.ValidationException vex) {\r
772             return false;\r
773         }\r
774         return true;\r
775     }\r
776 \r
777     /**\r
778      * \r
779      * \r
780      * @param out\r
781      * @throws org.exolab.castor.xml.MarshalException if object is\r
782      * null or if any SAXException is thrown during marshaling\r
783      * @throws org.exolab.castor.xml.ValidationException if this\r
784      * object is an invalid instance according to the schema\r
785      */\r
786     public void marshal(\r
787             final java.io.Writer out)\r
788     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
789         Marshaller.marshal(this, out);\r
790     }\r
791 \r
792     /**\r
793      * \r
794      * \r
795      * @param handler\r
796      * @throws java.io.IOException if an IOException occurs during\r
797      * marshaling\r
798      * @throws org.exolab.castor.xml.ValidationException if this\r
799      * object is an invalid instance according to the schema\r
800      * @throws org.exolab.castor.xml.MarshalException if object is\r
801      * null or if any SAXException is thrown during marshaling\r
802      */\r
803     public void marshal(\r
804             final org.xml.sax.ContentHandler handler)\r
805     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
806         Marshaller.marshal(this, handler);\r
807     }\r
808 \r
809     /**\r
810      */\r
811     public void removeAllAnnotationElement(\r
812     ) {\r
813         this._annotationElementList.clear();\r
814     }\r
815 \r
816     /**\r
817      */\r
818     public void removeAllLink(\r
819     ) {\r
820         this._linkList.clear();\r
821     }\r
822 \r
823     /**\r
824      */\r
825     public void removeAllProperty(\r
826     ) {\r
827         this._propertyList.clear();\r
828     }\r
829 \r
830     /**\r
831      */\r
832     public void removeAllScore(\r
833     ) {\r
834         this._scoreList.clear();\r
835     }\r
836 \r
837     /**\r
838      * Method removeAnnotationElement.\r
839      * \r
840      * @param vAnnotationElement\r
841      * @return true if the object was removed from the collection.\r
842      */\r
843     public boolean removeAnnotationElement(\r
844             final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) {\r
845         boolean removed = _annotationElementList.remove(vAnnotationElement);\r
846         return removed;\r
847     }\r
848 \r
849     /**\r
850      * Method removeAnnotationElementAt.\r
851      * \r
852      * @param index\r
853      * @return the element removed from the collection\r
854      */\r
855     public uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElementAt(\r
856             final int index) {\r
857         java.lang.Object obj = this._annotationElementList.remove(index);\r
858         return (uk.ac.vamsas.objects.core.AnnotationElement) obj;\r
859     }\r
860 \r
861     /**\r
862      * Method removeLink.\r
863      * \r
864      * @param vLink\r
865      * @return true if the object was removed from the collection.\r
866      */\r
867     public boolean removeLink(\r
868             final uk.ac.vamsas.objects.core.Link vLink) {\r
869         boolean removed = _linkList.remove(vLink);\r
870         return removed;\r
871     }\r
872 \r
873     /**\r
874      * Method removeLinkAt.\r
875      * \r
876      * @param index\r
877      * @return the element removed from the collection\r
878      */\r
879     public uk.ac.vamsas.objects.core.Link removeLinkAt(\r
880             final int index) {\r
881         java.lang.Object obj = this._linkList.remove(index);\r
882         return (uk.ac.vamsas.objects.core.Link) obj;\r
883     }\r
884 \r
885     /**\r
886      * Method removeProperty.\r
887      * \r
888      * @param vProperty\r
889      * @return true if the object was removed from the collection.\r
890      */\r
891     public boolean removeProperty(\r
892             final uk.ac.vamsas.objects.core.Property vProperty) {\r
893         boolean removed = _propertyList.remove(vProperty);\r
894         return removed;\r
895     }\r
896 \r
897     /**\r
898      * Method removePropertyAt.\r
899      * \r
900      * @param index\r
901      * @return the element removed from the collection\r
902      */\r
903     public uk.ac.vamsas.objects.core.Property removePropertyAt(\r
904             final int index) {\r
905         java.lang.Object obj = this._propertyList.remove(index);\r
906         return (uk.ac.vamsas.objects.core.Property) obj;\r
907     }\r
908 \r
909     /**\r
910      * Method removeScore.\r
911      * \r
912      * @param vScore\r
913      * @return true if the object was removed from the collection.\r
914      */\r
915     public boolean removeScore(\r
916             final uk.ac.vamsas.objects.core.Score vScore) {\r
917         boolean removed = _scoreList.remove(vScore);\r
918         return removed;\r
919     }\r
920 \r
921     /**\r
922      * Method removeScoreAt.\r
923      * \r
924      * @param index\r
925      * @return the element removed from the collection\r
926      */\r
927     public uk.ac.vamsas.objects.core.Score removeScoreAt(\r
928             final int index) {\r
929         java.lang.Object obj = this._scoreList.remove(index);\r
930         return (uk.ac.vamsas.objects.core.Score) obj;\r
931     }\r
932 \r
933     /**\r
934      * \r
935      * \r
936      * @param index\r
937      * @param vAnnotationElement\r
938      * @throws java.lang.IndexOutOfBoundsException if the index\r
939      * given is outside the bounds of the collection\r
940      */\r
941     public void setAnnotationElement(\r
942             final int index,\r
943             final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)\r
944     throws java.lang.IndexOutOfBoundsException {\r
945         // check bounds for index\r
946         if (index < 0 || index >= this._annotationElementList.size()) {\r
947             throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");\r
948         }\r
949         \r
950         this._annotationElementList.set(index, vAnnotationElement);\r
951     }\r
952 \r
953     /**\r
954      * \r
955      * \r
956      * @param vAnnotationElementArray\r
957      */\r
958     public void setAnnotationElement(\r
959             final uk.ac.vamsas.objects.core.AnnotationElement[] vAnnotationElementArray) {\r
960         //-- copy array\r
961         _annotationElementList.clear();\r
962         \r
963         for (int i = 0; i < vAnnotationElementArray.length; i++) {\r
964                 this._annotationElementList.add(vAnnotationElementArray[i]);\r
965         }\r
966     }\r
967 \r
968     /**\r
969      * Sets the value of '_annotationElementList' by copying the\r
970      * given Vector. All elements will be checked for type safety.\r
971      * \r
972      * @param vAnnotationElementList the Vector to copy.\r
973      */\r
974     public void setAnnotationElement(\r
975             final java.util.Vector vAnnotationElementList) {\r
976         // copy vector\r
977         this._annotationElementList.clear();\r
978         \r
979         this._annotationElementList.addAll(vAnnotationElementList);\r
980     }\r
981 \r
982     /**\r
983      * Sets the value of '_annotationElementList' by setting it to\r
984      * the given Vector. No type checking is performed.\r
985      * @deprecated\r
986      * \r
987      * @param annotationElementVector the Vector to set.\r
988      */\r
989     public void setAnnotationElementAsReference(\r
990             final java.util.Vector annotationElementVector) {\r
991         this._annotationElementList = annotationElementVector;\r
992     }\r
993 \r
994     /**\r
995      * Sets the value of field 'description'. The field\r
996      * 'description' has the following description: Human readable\r
997      * description of the annotation\r
998      *  \r
999      * \r
1000      * @param description the value of field 'description'.\r
1001      */\r
1002     public void setDescription(\r
1003             final java.lang.String description) {\r
1004         this._description = description;\r
1005     }\r
1006 \r
1007     /**\r
1008      * Sets the value of field 'group'. The field 'group' has the\r
1009      * following description: Annotation with the same non-empty\r
1010      * group name are grouped\r
1011      *  together \r
1012      * \r
1013      * @param group the value of field 'group'.\r
1014      */\r
1015     public void setGroup(\r
1016             final java.lang.String group) {\r
1017         this._group = group;\r
1018     }\r
1019 \r
1020     /**\r
1021      * Sets the value of field 'id'. The field 'id' has the\r
1022      * following description: Primary Key for vamsas object\r
1023      * referencing\r
1024      *  \r
1025      * \r
1026      * @param id the value of field 'id'.\r
1027      */\r
1028     public void setId(\r
1029             final java.lang.String id) {\r
1030         this._id = id;\r
1031     }\r
1032 \r
1033     /**\r
1034      * Sets the value of field 'label'. The field 'label' has the\r
1035      * following description: Short, meaningful name for the\r
1036      * annotation - if this\r
1037      *  is absent, then the type string should be used in its\r
1038      * place.\r
1039      *  \r
1040      * \r
1041      * @param label the value of field 'label'.\r
1042      */\r
1043     public void setLabel(\r
1044             final java.lang.String label) {\r
1045         this._label = label;\r
1046     }\r
1047 \r
1048     /**\r
1049      * \r
1050      * \r
1051      * @param index\r
1052      * @param vLink\r
1053      * @throws java.lang.IndexOutOfBoundsException if the index\r
1054      * given is outside the bounds of the collection\r
1055      */\r
1056     public void setLink(\r
1057             final int index,\r
1058             final uk.ac.vamsas.objects.core.Link vLink)\r
1059     throws java.lang.IndexOutOfBoundsException {\r
1060         // check bounds for index\r
1061         if (index < 0 || index >= this._linkList.size()) {\r
1062             throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");\r
1063         }\r
1064         \r
1065         this._linkList.set(index, vLink);\r
1066     }\r
1067 \r
1068     /**\r
1069      * \r
1070      * \r
1071      * @param vLinkArray\r
1072      */\r
1073     public void setLink(\r
1074             final uk.ac.vamsas.objects.core.Link[] vLinkArray) {\r
1075         //-- copy array\r
1076         _linkList.clear();\r
1077         \r
1078         for (int i = 0; i < vLinkArray.length; i++) {\r
1079                 this._linkList.add(vLinkArray[i]);\r
1080         }\r
1081     }\r
1082 \r
1083     /**\r
1084      * Sets the value of '_linkList' by copying the given Vector.\r
1085      * All elements will be checked for type safety.\r
1086      * \r
1087      * @param vLinkList the Vector to copy.\r
1088      */\r
1089     public void setLink(\r
1090             final java.util.Vector vLinkList) {\r
1091         // copy vector\r
1092         this._linkList.clear();\r
1093         \r
1094         this._linkList.addAll(vLinkList);\r
1095     }\r
1096 \r
1097     /**\r
1098      * Sets the value of '_linkList' by setting it to the given\r
1099      * Vector. No type checking is performed.\r
1100      * @deprecated\r
1101      * \r
1102      * @param linkVector the Vector to set.\r
1103      */\r
1104     public void setLinkAsReference(\r
1105             final java.util.Vector linkVector) {\r
1106         this._linkList = linkVector;\r
1107     }\r
1108 \r
1109     /**\r
1110      * Sets the value of field 'modifiable'.\r
1111      * \r
1112      * @param modifiable the value of field 'modifiable'.\r
1113      */\r
1114     public void setModifiable(\r
1115             final java.lang.String modifiable) {\r
1116         this._modifiable = modifiable;\r
1117     }\r
1118 \r
1119     /**\r
1120      * \r
1121      * \r
1122      * @param index\r
1123      * @param vProperty\r
1124      * @throws java.lang.IndexOutOfBoundsException if the index\r
1125      * given is outside the bounds of the collection\r
1126      */\r
1127     public void setProperty(\r
1128             final int index,\r
1129             final uk.ac.vamsas.objects.core.Property vProperty)\r
1130     throws java.lang.IndexOutOfBoundsException {\r
1131         // check bounds for index\r
1132         if (index < 0 || index >= this._propertyList.size()) {\r
1133             throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");\r
1134         }\r
1135         \r
1136         this._propertyList.set(index, vProperty);\r
1137     }\r
1138 \r
1139     /**\r
1140      * \r
1141      * \r
1142      * @param vPropertyArray\r
1143      */\r
1144     public void setProperty(\r
1145             final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {\r
1146         //-- copy array\r
1147         _propertyList.clear();\r
1148         \r
1149         for (int i = 0; i < vPropertyArray.length; i++) {\r
1150                 this._propertyList.add(vPropertyArray[i]);\r
1151         }\r
1152     }\r
1153 \r
1154     /**\r
1155      * Sets the value of '_propertyList' by copying the given\r
1156      * Vector. All elements will be checked for type safety.\r
1157      * \r
1158      * @param vPropertyList the Vector to copy.\r
1159      */\r
1160     public void setProperty(\r
1161             final java.util.Vector vPropertyList) {\r
1162         // copy vector\r
1163         this._propertyList.clear();\r
1164         \r
1165         this._propertyList.addAll(vPropertyList);\r
1166     }\r
1167 \r
1168     /**\r
1169      * Sets the value of '_propertyList' by setting it to the given\r
1170      * Vector. No type checking is performed.\r
1171      * @deprecated\r
1172      * \r
1173      * @param propertyVector the Vector to set.\r
1174      */\r
1175     public void setPropertyAsReference(\r
1176             final java.util.Vector propertyVector) {\r
1177         this._propertyList = propertyVector;\r
1178     }\r
1179 \r
1180     /**\r
1181      * \r
1182      * \r
1183      * @param index\r
1184      * @param vScore\r
1185      * @throws java.lang.IndexOutOfBoundsException if the index\r
1186      * given is outside the bounds of the collection\r
1187      */\r
1188     public void setScore(\r
1189             final int index,\r
1190             final uk.ac.vamsas.objects.core.Score vScore)\r
1191     throws java.lang.IndexOutOfBoundsException {\r
1192         // check bounds for index\r
1193         if (index < 0 || index >= this._scoreList.size()) {\r
1194             throw new IndexOutOfBoundsException("setScore: Index value '" + index + "' not in range [0.." + (this._scoreList.size() - 1) + "]");\r
1195         }\r
1196         \r
1197         this._scoreList.set(index, vScore);\r
1198     }\r
1199 \r
1200     /**\r
1201      * \r
1202      * \r
1203      * @param vScoreArray\r
1204      */\r
1205     public void setScore(\r
1206             final uk.ac.vamsas.objects.core.Score[] vScoreArray) {\r
1207         //-- copy array\r
1208         _scoreList.clear();\r
1209         \r
1210         for (int i = 0; i < vScoreArray.length; i++) {\r
1211                 this._scoreList.add(vScoreArray[i]);\r
1212         }\r
1213     }\r
1214 \r
1215     /**\r
1216      * Sets the value of '_scoreList' by copying the given Vector.\r
1217      * All elements will be checked for type safety.\r
1218      * \r
1219      * @param vScoreList the Vector to copy.\r
1220      */\r
1221     public void setScore(\r
1222             final java.util.Vector vScoreList) {\r
1223         // copy vector\r
1224         this._scoreList.clear();\r
1225         \r
1226         this._scoreList.addAll(vScoreList);\r
1227     }\r
1228 \r
1229     /**\r
1230      * Sets the value of '_scoreList' by setting it to the given\r
1231      * Vector. No type checking is performed.\r
1232      * @deprecated\r
1233      * \r
1234      * @param scoreVector the Vector to set.\r
1235      */\r
1236     public void setScoreAsReference(\r
1237             final java.util.Vector scoreVector) {\r
1238         this._scoreList = scoreVector;\r
1239     }\r
1240 \r
1241     /**\r
1242      * Sets the value of field 'status'. The field 'status' has the\r
1243      * following description: TODO: specify this - we have\r
1244      * considered taking the GO\r
1245      *  evidence codes as a model for assessing a measure of\r
1246      * quality to an\r
1247      *  annotation. \r
1248      * \r
1249      * @param status the value of field 'status'.\r
1250      */\r
1251     public void setStatus(\r
1252             final java.lang.String status) {\r
1253         this._status = status;\r
1254     }\r
1255 \r
1256     /**\r
1257      * Sets the value of field 'type'. The field 'type' has the\r
1258      * following description: A Das Feature has both a type and a\r
1259      * Type ID. We go the\r
1260      *  route of requiring the type string to be taken from a\r
1261      * controlled\r
1262      *  vocabulary if an application expects others to make sense\r
1263      * of it. The\r
1264      *  type may qualified - so uniprot:CHAIN is a valid type name,\r
1265      * and\r
1266      *  considered distinct from someotherDB:CHAIN \r
1267      * \r
1268      * @param type the value of field 'type'.\r
1269      */\r
1270     public void setType(\r
1271             final java.lang.String type) {\r
1272         this._type = type;\r
1273     }\r
1274 \r
1275     /**\r
1276      * Method unmarshal.\r
1277      * \r
1278      * @param reader\r
1279      * @throws org.exolab.castor.xml.MarshalException if object is\r
1280      * null or if any SAXException is thrown during marshaling\r
1281      * @throws org.exolab.castor.xml.ValidationException if this\r
1282      * object is an invalid instance according to the schema\r
1283      * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType\r
1284      */\r
1285     public static uk.ac.vamsas.objects.core.RangeType unmarshal(\r
1286             final java.io.Reader reader)\r
1287     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
1288         return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.RangeAnnotation.class, reader);\r
1289     }\r
1290 \r
1291     /**\r
1292      * \r
1293      * \r
1294      * @throws org.exolab.castor.xml.ValidationException if this\r
1295      * object is an invalid instance according to the schema\r
1296      */\r
1297     public void validate(\r
1298     )\r
1299     throws org.exolab.castor.xml.ValidationException {\r
1300         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
1301         validator.validate(this);\r
1302     }\r
1303 \r
1304 }\r