sequence mappings and DbRef mapping objects unified and source binding for castor...
[vamsas.git] / src / uk / ac / vamsas / objects / core / DbRef.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Store a list of database references
19  *  for this sequence record - with optional mapping
20  *  from database sequence to the given sequence record 
21  * 
22  * @version $Revision$ $Date$
23  */
24 public class DbRef extends uk.ac.vamsas.client.Vobject 
25 implements java.io.Serializable
26 {
27
28
29       //--------------------------/
30      //- Class/Member Variables -/
31     //--------------------------/
32
33     /**
34      * TODO Database Naming
35      *  Convention: either start using LSID (so
36      *  change type to URI) or leave this as an
37      *  uncontrolled/unspecified string ID
38      *  
39      */
40     private java.lang.String _source;
41
42     /**
43      * Version must be specified -
44      *  
45      */
46     private java.lang.String _version;
47
48     /**
49      * TODO: make some specification
50      *  of the database field from which this
51      *  accessionId is taken from - should that be a
52      *  special property of the dbRef object ?
53      *  
54      */
55     private java.lang.String _accessionId;
56
57     /**
58      * Primary Key for vamsas object
59      *  referencing 
60      */
61     private java.lang.String _id;
62
63     /**
64      * the local mapType maps from the parent
65      *  sequence coordinate frame to the reference
66      *  frame defined by the dbRef element.
67      *  The mapped mapType is the mapped range defined
68      *  on the dbRef element's reference frame.
69      *  Conventionally, the unit attribute defaults to 1, or
70      *  will be inferred from the local sequence's
71      *  dictionary type and any dictionary type associated
72      *  with the database being mapped to. 
73      *  However, it may be used to avoid ambiguity.
74      *  
75      */
76     private uk.ac.vamsas.objects.core.Map _map;
77
78     /**
79      * Field _linkList.
80      */
81     private java.util.Vector _linkList;
82
83     /**
84      * Field _propertyList.
85      */
86     private java.util.Vector _propertyList;
87
88
89       //----------------/
90      //- Constructors -/
91     //----------------/
92
93     public DbRef() {
94         super();
95         this._linkList = new java.util.Vector();
96         this._propertyList = new java.util.Vector();
97     }
98
99
100       //-----------/
101      //- Methods -/
102     //-----------/
103
104     /**
105      * 
106      * 
107      * @param vLink
108      * @throws java.lang.IndexOutOfBoundsException if the index
109      * given is outside the bounds of the collection
110      */
111     public void addLink(
112             final uk.ac.vamsas.objects.core.Link vLink)
113     throws java.lang.IndexOutOfBoundsException {
114         this._linkList.addElement(vLink);
115     }
116
117     /**
118      * 
119      * 
120      * @param index
121      * @param vLink
122      * @throws java.lang.IndexOutOfBoundsException if the index
123      * given is outside the bounds of the collection
124      */
125     public void addLink(
126             final int index,
127             final uk.ac.vamsas.objects.core.Link vLink)
128     throws java.lang.IndexOutOfBoundsException {
129         this._linkList.add(index, vLink);
130     }
131
132     /**
133      * 
134      * 
135      * @param vProperty
136      * @throws java.lang.IndexOutOfBoundsException if the index
137      * given is outside the bounds of the collection
138      */
139     public void addProperty(
140             final uk.ac.vamsas.objects.core.Property vProperty)
141     throws java.lang.IndexOutOfBoundsException {
142         this._propertyList.addElement(vProperty);
143     }
144
145     /**
146      * 
147      * 
148      * @param index
149      * @param vProperty
150      * @throws java.lang.IndexOutOfBoundsException if the index
151      * given is outside the bounds of the collection
152      */
153     public void addProperty(
154             final int index,
155             final uk.ac.vamsas.objects.core.Property vProperty)
156     throws java.lang.IndexOutOfBoundsException {
157         this._propertyList.add(index, vProperty);
158     }
159
160     /**
161      * Method enumerateLink.
162      * 
163      * @return an Enumeration over all
164      * uk.ac.vamsas.objects.core.Link elements
165      */
166     public java.util.Enumeration enumerateLink(
167     ) {
168         return this._linkList.elements();
169     }
170
171     /**
172      * Method enumerateProperty.
173      * 
174      * @return an Enumeration over all
175      * uk.ac.vamsas.objects.core.Property elements
176      */
177     public java.util.Enumeration enumerateProperty(
178     ) {
179         return this._propertyList.elements();
180     }
181
182     /**
183      * Overrides the java.lang.Object.equals method.
184      * 
185      * @param obj
186      * @return true if the objects are equal.
187      */
188     public boolean equals(
189             final java.lang.Object obj) {
190         if ( this == obj )
191             return true;
192         
193         if (super.equals(obj)==false)
194             return false;
195         
196         if (obj instanceof DbRef) {
197         
198             DbRef temp = (DbRef)obj;
199             boolean thcycle;
200             boolean tmcycle;
201             if (this._source != null) {
202                 if (temp._source == null) return false;
203                 if (this._source != temp._source) {
204                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._source);
205                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._source);
206                     if (thcycle!=tmcycle) {
207                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._source); };
208                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._source); };
209                         return false;
210                     }
211                     if (!thcycle) {
212                         if (!this._source.equals(temp._source)) {
213                             org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
214                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
215                             return false;
216                         }
217                         org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
218                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
219                     }
220                 }
221             } else if (temp._source != null)
222                 return false;
223             if (this._version != null) {
224                 if (temp._version == null) return false;
225                 if (this._version != temp._version) {
226                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version);
227                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version);
228                     if (thcycle!=tmcycle) {
229                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); };
230                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); };
231                         return false;
232                     }
233                     if (!thcycle) {
234                         if (!this._version.equals(temp._version)) {
235                             org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
236                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
237                             return false;
238                         }
239                         org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
240                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
241                     }
242                 }
243             } else if (temp._version != null)
244                 return false;
245             if (this._accessionId != null) {
246                 if (temp._accessionId == null) return false;
247                 if (this._accessionId != temp._accessionId) {
248                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._accessionId);
249                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._accessionId);
250                     if (thcycle!=tmcycle) {
251                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId); };
252                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId); };
253                         return false;
254                     }
255                     if (!thcycle) {
256                         if (!this._accessionId.equals(temp._accessionId)) {
257                             org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
258                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
259                             return false;
260                         }
261                         org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
262                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
263                     }
264                 }
265             } else if (temp._accessionId != null)
266                 return false;
267             if (this._id != null) {
268                 if (temp._id == null) return false;
269                 if (this._id != temp._id) {
270                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
271                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
272                     if (thcycle!=tmcycle) {
273                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
274                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
275                         return false;
276                     }
277                     if (!thcycle) {
278                         if (!this._id.equals(temp._id)) {
279                             org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
280                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
281                             return false;
282                         }
283                         org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
284                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
285                     }
286                 }
287             } else if (temp._id != null)
288                 return false;
289             if (this._map != null) {
290                 if (temp._map == null) return false;
291                 if (this._map != temp._map) {
292                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._map);
293                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._map);
294                     if (thcycle!=tmcycle) {
295                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._map); };
296                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); };
297                         return false;
298                     }
299                     if (!thcycle) {
300                         if (!this._map.equals(temp._map)) {
301                             org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
302                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
303                             return false;
304                         }
305                         org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
306                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
307                     }
308                 }
309             } else if (temp._map != null)
310                 return false;
311             if (this._linkList != null) {
312                 if (temp._linkList == null) return false;
313                 if (this._linkList != temp._linkList) {
314                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._linkList);
315                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._linkList);
316                     if (thcycle!=tmcycle) {
317                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); };
318                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); };
319                         return false;
320                     }
321                     if (!thcycle) {
322                         if (!this._linkList.equals(temp._linkList)) {
323                             org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
324                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
325                             return false;
326                         }
327                         org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
328                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
329                     }
330                 }
331             } else if (temp._linkList != null)
332                 return false;
333             if (this._propertyList != null) {
334                 if (temp._propertyList == null) return false;
335                 if (this._propertyList != temp._propertyList) {
336                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
337                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
338                     if (thcycle!=tmcycle) {
339                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
340                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
341                         return false;
342                     }
343                     if (!thcycle) {
344                         if (!this._propertyList.equals(temp._propertyList)) {
345                             org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
346                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
347                             return false;
348                         }
349                         org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
350                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
351                     }
352                 }
353             } else if (temp._propertyList != null)
354                 return false;
355             return true;
356         }
357         return false;
358     }
359
360     /**
361      * Returns the value of field 'accessionId'. The field
362      * 'accessionId' has the following description: TODO: make some
363      * specification
364      *  of the database field from which this
365      *  accessionId is taken from - should that be a
366      *  special property of the dbRef object ?
367      *  
368      * 
369      * @return the value of field 'AccessionId'.
370      */
371     public java.lang.String getAccessionId(
372     ) {
373         return this._accessionId;
374     }
375
376     /**
377      * Returns the value of field 'id'. The field 'id' has the
378      * following description: Primary Key for vamsas object
379      *  referencing 
380      * 
381      * @return the value of field 'Id'.
382      */
383     public java.lang.String getId(
384     ) {
385         return this._id;
386     }
387
388     /**
389      * Method getLink.
390      * 
391      * @param index
392      * @throws java.lang.IndexOutOfBoundsException if the index
393      * given is outside the bounds of the collection
394      * @return the value of the uk.ac.vamsas.objects.core.Link at
395      * the given index
396      */
397     public uk.ac.vamsas.objects.core.Link getLink(
398             final int index)
399     throws java.lang.IndexOutOfBoundsException {
400         // check bounds for index
401         if (index < 0 || index >= this._linkList.size()) {
402             throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
403         }
404         
405         return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);
406     }
407
408     /**
409      * Method getLink.Returns the contents of the collection in an
410      * Array.  <p>Note:  Just in case the collection contents are
411      * changing in another thread, we pass a 0-length Array of the
412      * correct type into the API call.  This way we <i>know</i>
413      * that the Array returned is of exactly the correct length.
414      * 
415      * @return this collection as an Array
416      */
417     public uk.ac.vamsas.objects.core.Link[] getLink(
418     ) {
419         uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];
420         return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);
421     }
422
423     /**
424      * Method getLinkAsReference.Returns a reference to
425      * '_linkList'. No type checking is performed on any
426      * modifications to the Vector.
427      * 
428      * @return a reference to the Vector backing this class
429      */
430     public java.util.Vector getLinkAsReference(
431     ) {
432         return this._linkList;
433     }
434
435     /**
436      * Method getLinkCount.
437      * 
438      * @return the size of this collection
439      */
440     public int getLinkCount(
441     ) {
442         return this._linkList.size();
443     }
444
445     /**
446      * Returns the value of field 'map'. The field 'map' has the
447      * following description: the local mapType maps from the
448      * parent
449      *  sequence coordinate frame to the reference
450      *  frame defined by the dbRef element.
451      *  The mapped mapType is the mapped range defined
452      *  on the dbRef element's reference frame.
453      *  Conventionally, the unit attribute defaults to 1, or
454      *  will be inferred from the local sequence's
455      *  dictionary type and any dictionary type associated
456      *  with the database being mapped to. 
457      *  However, it may be used to avoid ambiguity.
458      *  
459      * 
460      * @return the value of field 'Map'.
461      */
462     public uk.ac.vamsas.objects.core.Map getMap(
463     ) {
464         return this._map;
465     }
466
467     /**
468      * Method getProperty.
469      * 
470      * @param index
471      * @throws java.lang.IndexOutOfBoundsException if the index
472      * given is outside the bounds of the collection
473      * @return the value of the uk.ac.vamsas.objects.core.Property
474      * at the given index
475      */
476     public uk.ac.vamsas.objects.core.Property getProperty(
477             final int index)
478     throws java.lang.IndexOutOfBoundsException {
479         // check bounds for index
480         if (index < 0 || index >= this._propertyList.size()) {
481             throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
482         }
483         
484         return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
485     }
486
487     /**
488      * Method getProperty.Returns the contents of the collection in
489      * an Array.  <p>Note:  Just in case the collection contents
490      * are changing in another thread, we pass a 0-length Array of
491      * the correct type into the API call.  This way we <i>know</i>
492      * that the Array returned is of exactly the correct length.
493      * 
494      * @return this collection as an Array
495      */
496     public uk.ac.vamsas.objects.core.Property[] getProperty(
497     ) {
498         uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
499         return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
500     }
501
502     /**
503      * Method getPropertyAsReference.Returns a reference to
504      * '_propertyList'. No type checking is performed on any
505      * modifications to the Vector.
506      * 
507      * @return a reference to the Vector backing this class
508      */
509     public java.util.Vector getPropertyAsReference(
510     ) {
511         return this._propertyList;
512     }
513
514     /**
515      * Method getPropertyCount.
516      * 
517      * @return the size of this collection
518      */
519     public int getPropertyCount(
520     ) {
521         return this._propertyList.size();
522     }
523
524     /**
525      * Returns the value of field 'source'. The field 'source' has
526      * the following description: TODO Database Naming
527      *  Convention: either start using LSID (so
528      *  change type to URI) or leave this as an
529      *  uncontrolled/unspecified string ID
530      *  
531      * 
532      * @return the value of field 'Source'.
533      */
534     public java.lang.String getSource(
535     ) {
536         return this._source;
537     }
538
539     /**
540      * Returns the value of field 'version'. The field 'version'
541      * has the following description: Version must be specified -
542      *  
543      * 
544      * @return the value of field 'Version'.
545      */
546     public java.lang.String getVersion(
547     ) {
548         return this._version;
549     }
550
551     /**
552      * Overrides the java.lang.Object.hashCode method.
553      * <p>
554      * The following steps came from <b>Effective Java Programming
555      * Language Guide</b> by Joshua Bloch, Chapter 3
556      * 
557      * @return a hash code value for the object.
558      */
559     public int hashCode(
560     ) {
561         int result = super.hashCode();
562         
563         long tmp;
564         if (_source != null
565             && !org.castor.util.CycleBreaker.startingToCycle(_source)) {
566            result = 37 * result + _source.hashCode();
567            org.castor.util.CycleBreaker.releaseCycleHandle(_source);
568         }
569         if (_version != null
570             && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
571            result = 37 * result + _version.hashCode();
572            org.castor.util.CycleBreaker.releaseCycleHandle(_version);
573         }
574         if (_accessionId != null
575             && !org.castor.util.CycleBreaker.startingToCycle(_accessionId)) {
576            result = 37 * result + _accessionId.hashCode();
577            org.castor.util.CycleBreaker.releaseCycleHandle(_accessionId);
578         }
579         if (_id != null
580             && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
581            result = 37 * result + _id.hashCode();
582            org.castor.util.CycleBreaker.releaseCycleHandle(_id);
583         }
584         if (_map != null
585             && !org.castor.util.CycleBreaker.startingToCycle(_map)) {
586            result = 37 * result + _map.hashCode();
587            org.castor.util.CycleBreaker.releaseCycleHandle(_map);
588         }
589         if (_linkList != null
590             && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) {
591            result = 37 * result + _linkList.hashCode();
592            org.castor.util.CycleBreaker.releaseCycleHandle(_linkList);
593         }
594         if (_propertyList != null
595             && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
596            result = 37 * result + _propertyList.hashCode();
597            org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
598         }
599         
600         return result;
601     }
602
603     /**
604      * Method isValid.
605      * 
606      * @return true if this object is valid according to the schema
607      */
608     public boolean isValid(
609     ) {
610         try {
611             validate();
612         } catch (org.exolab.castor.xml.ValidationException vex) {
613             return false;
614         }
615         return true;
616     }
617
618     /**
619      * 
620      * 
621      * @param out
622      * @throws org.exolab.castor.xml.MarshalException if object is
623      * null or if any SAXException is thrown during marshaling
624      * @throws org.exolab.castor.xml.ValidationException if this
625      * object is an invalid instance according to the schema
626      */
627     public void marshal(
628             final java.io.Writer out)
629     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
630         Marshaller.marshal(this, out);
631     }
632
633     /**
634      * 
635      * 
636      * @param handler
637      * @throws java.io.IOException if an IOException occurs during
638      * marshaling
639      * @throws org.exolab.castor.xml.ValidationException if this
640      * object is an invalid instance according to the schema
641      * @throws org.exolab.castor.xml.MarshalException if object is
642      * null or if any SAXException is thrown during marshaling
643      */
644     public void marshal(
645             final org.xml.sax.ContentHandler handler)
646     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
647         Marshaller.marshal(this, handler);
648     }
649
650     /**
651      */
652     public void removeAllLink(
653     ) {
654         this._linkList.clear();
655     }
656
657     /**
658      */
659     public void removeAllProperty(
660     ) {
661         this._propertyList.clear();
662     }
663
664     /**
665      * Method removeLink.
666      * 
667      * @param vLink
668      * @return true if the object was removed from the collection.
669      */
670     public boolean removeLink(
671             final uk.ac.vamsas.objects.core.Link vLink) {
672         boolean removed = _linkList.remove(vLink);
673         return removed;
674     }
675
676     /**
677      * Method removeLinkAt.
678      * 
679      * @param index
680      * @return the element removed from the collection
681      */
682     public uk.ac.vamsas.objects.core.Link removeLinkAt(
683             final int index) {
684         java.lang.Object obj = this._linkList.remove(index);
685         return (uk.ac.vamsas.objects.core.Link) obj;
686     }
687
688     /**
689      * Method removeProperty.
690      * 
691      * @param vProperty
692      * @return true if the object was removed from the collection.
693      */
694     public boolean removeProperty(
695             final uk.ac.vamsas.objects.core.Property vProperty) {
696         boolean removed = _propertyList.remove(vProperty);
697         return removed;
698     }
699
700     /**
701      * Method removePropertyAt.
702      * 
703      * @param index
704      * @return the element removed from the collection
705      */
706     public uk.ac.vamsas.objects.core.Property removePropertyAt(
707             final int index) {
708         java.lang.Object obj = this._propertyList.remove(index);
709         return (uk.ac.vamsas.objects.core.Property) obj;
710     }
711
712     /**
713      * Sets the value of field 'accessionId'. The field
714      * 'accessionId' has the following description: TODO: make some
715      * specification
716      *  of the database field from which this
717      *  accessionId is taken from - should that be a
718      *  special property of the dbRef object ?
719      *  
720      * 
721      * @param accessionId the value of field 'accessionId'.
722      */
723     public void setAccessionId(
724             final java.lang.String accessionId) {
725         this._accessionId = accessionId;
726     }
727
728     /**
729      * Sets the value of field 'id'. The field 'id' has the
730      * following description: Primary Key for vamsas object
731      *  referencing 
732      * 
733      * @param id the value of field 'id'.
734      */
735     public void setId(
736             final java.lang.String id) {
737         this._id = id;
738     }
739
740     /**
741      * 
742      * 
743      * @param index
744      * @param vLink
745      * @throws java.lang.IndexOutOfBoundsException if the index
746      * given is outside the bounds of the collection
747      */
748     public void setLink(
749             final int index,
750             final uk.ac.vamsas.objects.core.Link vLink)
751     throws java.lang.IndexOutOfBoundsException {
752         // check bounds for index
753         if (index < 0 || index >= this._linkList.size()) {
754             throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
755         }
756         
757         this._linkList.set(index, vLink);
758     }
759
760     /**
761      * 
762      * 
763      * @param vLinkArray
764      */
765     public void setLink(
766             final uk.ac.vamsas.objects.core.Link[] vLinkArray) {
767         //-- copy array
768         _linkList.clear();
769         
770         for (int i = 0; i < vLinkArray.length; i++) {
771                 this._linkList.add(vLinkArray[i]);
772         }
773     }
774
775     /**
776      * Sets the value of '_linkList' by copying the given Vector.
777      * All elements will be checked for type safety.
778      * 
779      * @param vLinkList the Vector to copy.
780      */
781     public void setLink(
782             final java.util.Vector vLinkList) {
783         // copy vector
784         this._linkList.clear();
785         
786         this._linkList.addAll(vLinkList);
787     }
788
789     /**
790      * Sets the value of '_linkList' by setting it to the given
791      * Vector. No type checking is performed.
792      * @deprecated
793      * 
794      * @param linkVector the Vector to set.
795      */
796     public void setLinkAsReference(
797             final java.util.Vector linkVector) {
798         this._linkList = linkVector;
799     }
800
801     /**
802      * Sets the value of field 'map'. The field 'map' has the
803      * following description: the local mapType maps from the
804      * parent
805      *  sequence coordinate frame to the reference
806      *  frame defined by the dbRef element.
807      *  The mapped mapType is the mapped range defined
808      *  on the dbRef element's reference frame.
809      *  Conventionally, the unit attribute defaults to 1, or
810      *  will be inferred from the local sequence's
811      *  dictionary type and any dictionary type associated
812      *  with the database being mapped to. 
813      *  However, it may be used to avoid ambiguity.
814      *  
815      * 
816      * @param map the value of field 'map'.
817      */
818     public void setMap(
819             final uk.ac.vamsas.objects.core.Map map) {
820         this._map = map;
821     }
822
823     /**
824      * 
825      * 
826      * @param index
827      * @param vProperty
828      * @throws java.lang.IndexOutOfBoundsException if the index
829      * given is outside the bounds of the collection
830      */
831     public void setProperty(
832             final int index,
833             final uk.ac.vamsas.objects.core.Property vProperty)
834     throws java.lang.IndexOutOfBoundsException {
835         // check bounds for index
836         if (index < 0 || index >= this._propertyList.size()) {
837             throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
838         }
839         
840         this._propertyList.set(index, vProperty);
841     }
842
843     /**
844      * 
845      * 
846      * @param vPropertyArray
847      */
848     public void setProperty(
849             final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
850         //-- copy array
851         _propertyList.clear();
852         
853         for (int i = 0; i < vPropertyArray.length; i++) {
854                 this._propertyList.add(vPropertyArray[i]);
855         }
856     }
857
858     /**
859      * Sets the value of '_propertyList' by copying the given
860      * Vector. All elements will be checked for type safety.
861      * 
862      * @param vPropertyList the Vector to copy.
863      */
864     public void setProperty(
865             final java.util.Vector vPropertyList) {
866         // copy vector
867         this._propertyList.clear();
868         
869         this._propertyList.addAll(vPropertyList);
870     }
871
872     /**
873      * Sets the value of '_propertyList' by setting it to the given
874      * Vector. No type checking is performed.
875      * @deprecated
876      * 
877      * @param propertyVector the Vector to set.
878      */
879     public void setPropertyAsReference(
880             final java.util.Vector propertyVector) {
881         this._propertyList = propertyVector;
882     }
883
884     /**
885      * Sets the value of field 'source'. The field 'source' has the
886      * following description: TODO Database Naming
887      *  Convention: either start using LSID (so
888      *  change type to URI) or leave this as an
889      *  uncontrolled/unspecified string ID
890      *  
891      * 
892      * @param source the value of field 'source'.
893      */
894     public void setSource(
895             final java.lang.String source) {
896         this._source = source;
897     }
898
899     /**
900      * Sets the value of field 'version'. The field 'version' has
901      * the following description: Version must be specified -
902      *  
903      * 
904      * @param version the value of field 'version'.
905      */
906     public void setVersion(
907             final java.lang.String version) {
908         this._version = version;
909     }
910
911     /**
912      * Method unmarshal.
913      * 
914      * @param reader
915      * @throws org.exolab.castor.xml.MarshalException if object is
916      * null or if any SAXException is thrown during marshaling
917      * @throws org.exolab.castor.xml.ValidationException if this
918      * object is an invalid instance according to the schema
919      * @return the unmarshaled uk.ac.vamsas.objects.core.DbRef
920      */
921     public static uk.ac.vamsas.objects.core.DbRef unmarshal(
922             final java.io.Reader reader)
923     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
924         return (uk.ac.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DbRef.class, reader);
925     }
926
927     /**
928      * 
929      * 
930      * @throws org.exolab.castor.xml.ValidationException if this
931      * object is an invalid instance according to the schema
932      */
933     public void validate(
934     )
935     throws org.exolab.castor.xml.ValidationException {
936         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
937         validator.validate(this);
938     }
939
940 }