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