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