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