7206791e56ae0f110d672030db53bcbe8d1ff4e1
[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 java.util.Vector _mapList;
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._mapList = new java.util.Vector();
96         this._linkList = new java.util.Vector();
97         this._propertyList = new java.util.Vector();
98     }
99
100
101       //-----------/
102      //- Methods -/
103     //-----------/
104
105     /**
106      * 
107      * 
108      * @param vLink
109      * @throws java.lang.IndexOutOfBoundsException if the index
110      * given is outside the bounds of the collection
111      */
112     public void addLink(
113             final uk.ac.vamsas.objects.core.Link vLink)
114     throws java.lang.IndexOutOfBoundsException {
115         this._linkList.addElement(vLink);
116     }
117
118     /**
119      * 
120      * 
121      * @param index
122      * @param vLink
123      * @throws java.lang.IndexOutOfBoundsException if the index
124      * given is outside the bounds of the collection
125      */
126     public void addLink(
127             final int index,
128             final uk.ac.vamsas.objects.core.Link vLink)
129     throws java.lang.IndexOutOfBoundsException {
130         this._linkList.add(index, vLink);
131     }
132
133     /**
134      * 
135      * 
136      * @param vMap
137      * @throws java.lang.IndexOutOfBoundsException if the index
138      * given is outside the bounds of the collection
139      */
140     public void addMap(
141             final uk.ac.vamsas.objects.core.Map vMap)
142     throws java.lang.IndexOutOfBoundsException {
143         this._mapList.addElement(vMap);
144     }
145
146     /**
147      * 
148      * 
149      * @param index
150      * @param vMap
151      * @throws java.lang.IndexOutOfBoundsException if the index
152      * given is outside the bounds of the collection
153      */
154     public void addMap(
155             final int index,
156             final uk.ac.vamsas.objects.core.Map vMap)
157     throws java.lang.IndexOutOfBoundsException {
158         this._mapList.add(index, vMap);
159     }
160
161     /**
162      * 
163      * 
164      * @param vProperty
165      * @throws java.lang.IndexOutOfBoundsException if the index
166      * given is outside the bounds of the collection
167      */
168     public void addProperty(
169             final uk.ac.vamsas.objects.core.Property vProperty)
170     throws java.lang.IndexOutOfBoundsException {
171         this._propertyList.addElement(vProperty);
172     }
173
174     /**
175      * 
176      * 
177      * @param index
178      * @param vProperty
179      * @throws java.lang.IndexOutOfBoundsException if the index
180      * given is outside the bounds of the collection
181      */
182     public void addProperty(
183             final int index,
184             final uk.ac.vamsas.objects.core.Property vProperty)
185     throws java.lang.IndexOutOfBoundsException {
186         this._propertyList.add(index, vProperty);
187     }
188
189     /**
190      * Method enumerateLink.
191      * 
192      * @return an Enumeration over all
193      * uk.ac.vamsas.objects.core.Link elements
194      */
195     public java.util.Enumeration enumerateLink(
196     ) {
197         return this._linkList.elements();
198     }
199
200     /**
201      * Method enumerateMap.
202      * 
203      * @return an Enumeration over all
204      * uk.ac.vamsas.objects.core.Map elements
205      */
206     public java.util.Enumeration enumerateMap(
207     ) {
208         return this._mapList.elements();
209     }
210
211     /**
212      * Method enumerateProperty.
213      * 
214      * @return an Enumeration over all
215      * uk.ac.vamsas.objects.core.Property elements
216      */
217     public java.util.Enumeration enumerateProperty(
218     ) {
219         return this._propertyList.elements();
220     }
221
222     /**
223      * Overrides the java.lang.Object.equals method.
224      * 
225      * @param obj
226      * @return true if the objects are equal.
227      */
228     public boolean equals(
229             final java.lang.Object obj) {
230         if ( this == obj )
231             return true;
232         
233         if (super.equals(obj)==false)
234             return false;
235         
236         if (obj instanceof DbRef) {
237         
238             DbRef temp = (DbRef)obj;
239             boolean thcycle;
240             boolean tmcycle;
241             if (this._source != null) {
242                 if (temp._source == null) return false;
243                 if (this._source != temp._source) {
244                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._source);
245                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._source);
246                     if (thcycle!=tmcycle) {
247                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._source); };
248                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._source); };
249                         return false;
250                     }
251                     if (!thcycle) {
252                         if (!this._source.equals(temp._source)) {
253                             org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
254                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
255                             return false;
256                         }
257                         org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
258                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
259                     }
260                 }
261             } else if (temp._source != null)
262                 return false;
263             if (this._version != null) {
264                 if (temp._version == null) return false;
265                 if (this._version != temp._version) {
266                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version);
267                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version);
268                     if (thcycle!=tmcycle) {
269                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); };
270                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); };
271                         return false;
272                     }
273                     if (!thcycle) {
274                         if (!this._version.equals(temp._version)) {
275                             org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
276                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
277                             return false;
278                         }
279                         org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
280                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
281                     }
282                 }
283             } else if (temp._version != null)
284                 return false;
285             if (this._accessionId != null) {
286                 if (temp._accessionId == null) return false;
287                 if (this._accessionId != temp._accessionId) {
288                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._accessionId);
289                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._accessionId);
290                     if (thcycle!=tmcycle) {
291                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId); };
292                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId); };
293                         return false;
294                     }
295                     if (!thcycle) {
296                         if (!this._accessionId.equals(temp._accessionId)) {
297                             org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
298                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
299                             return false;
300                         }
301                         org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
302                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
303                     }
304                 }
305             } else if (temp._accessionId != null)
306                 return false;
307             if (this._id != null) {
308                 if (temp._id == null) return false;
309                 if (this._id != temp._id) {
310                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
311                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
312                     if (thcycle!=tmcycle) {
313                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
314                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
315                         return false;
316                     }
317                     if (!thcycle) {
318                         if (!this._id.equals(temp._id)) {
319                             org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
320                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
321                             return false;
322                         }
323                         org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
324                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
325                     }
326                 }
327             } else if (temp._id != null)
328                 return false;
329             if (this._mapList != null) {
330                 if (temp._mapList == null) return false;
331                 if (this._mapList != temp._mapList) {
332                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._mapList);
333                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._mapList);
334                     if (thcycle!=tmcycle) {
335                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList); };
336                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList); };
337                         return false;
338                     }
339                     if (!thcycle) {
340                         if (!this._mapList.equals(temp._mapList)) {
341                             org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
342                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
343                             return false;
344                         }
345                         org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
346                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
347                     }
348                 }
349             } else if (temp._mapList != null)
350                 return false;
351             if (this._linkList != null) {
352                 if (temp._linkList == null) return false;
353                 if (this._linkList != temp._linkList) {
354                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._linkList);
355                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._linkList);
356                     if (thcycle!=tmcycle) {
357                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); };
358                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); };
359                         return false;
360                     }
361                     if (!thcycle) {
362                         if (!this._linkList.equals(temp._linkList)) {
363                             org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
364                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
365                             return false;
366                         }
367                         org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
368                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
369                     }
370                 }
371             } else if (temp._linkList != null)
372                 return false;
373             if (this._propertyList != null) {
374                 if (temp._propertyList == null) return false;
375                 if (this._propertyList != temp._propertyList) {
376                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
377                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
378                     if (thcycle!=tmcycle) {
379                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
380                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
381                         return false;
382                     }
383                     if (!thcycle) {
384                         if (!this._propertyList.equals(temp._propertyList)) {
385                             org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
386                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
387                             return false;
388                         }
389                         org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
390                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
391                     }
392                 }
393             } else if (temp._propertyList != null)
394                 return false;
395             return true;
396         }
397         return false;
398     }
399
400     /**
401      * Returns the value of field 'accessionId'. The field
402      * 'accessionId' has the following description: TODO: make some
403      * specification
404      *  of the database field from which this
405      *  accessionId is taken from - should that be a
406      *  special property of the dbRef object ?
407      *  
408      * 
409      * @return the value of field 'AccessionId'.
410      */
411     public java.lang.String getAccessionId(
412     ) {
413         return this._accessionId;
414     }
415
416     /**
417      * Returns the value of field 'id'. The field 'id' has the
418      * following description: Primary Key for vamsas object
419      *  referencing 
420      * 
421      * @return the value of field 'Id'.
422      */
423     public java.lang.String getId(
424     ) {
425         return this._id;
426     }
427
428     /**
429      * Method getLink.
430      * 
431      * @param index
432      * @throws java.lang.IndexOutOfBoundsException if the index
433      * given is outside the bounds of the collection
434      * @return the value of the uk.ac.vamsas.objects.core.Link at
435      * the given index
436      */
437     public uk.ac.vamsas.objects.core.Link getLink(
438             final int index)
439     throws java.lang.IndexOutOfBoundsException {
440         // check bounds for index
441         if (index < 0 || index >= this._linkList.size()) {
442             throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
443         }
444         
445         return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);
446     }
447
448     /**
449      * Method getLink.Returns the contents of the collection in an
450      * Array.  <p>Note:  Just in case the collection contents are
451      * changing in another thread, we pass a 0-length Array of the
452      * correct type into the API call.  This way we <i>know</i>
453      * that the Array returned is of exactly the correct length.
454      * 
455      * @return this collection as an Array
456      */
457     public uk.ac.vamsas.objects.core.Link[] getLink(
458     ) {
459         uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];
460         return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);
461     }
462
463     /**
464      * Method getLinkAsReference.Returns a reference to
465      * '_linkList'. No type checking is performed on any
466      * modifications to the Vector.
467      * 
468      * @return a reference to the Vector backing this class
469      */
470     public java.util.Vector getLinkAsReference(
471     ) {
472         return this._linkList;
473     }
474
475     /**
476      * Method getLinkCount.
477      * 
478      * @return the size of this collection
479      */
480     public int getLinkCount(
481     ) {
482         return this._linkList.size();
483     }
484
485     /**
486      * Method getMap.
487      * 
488      * @param index
489      * @throws java.lang.IndexOutOfBoundsException if the index
490      * given is outside the bounds of the collection
491      * @return the value of the uk.ac.vamsas.objects.core.Map at
492      * the given index
493      */
494     public uk.ac.vamsas.objects.core.Map getMap(
495             final int index)
496     throws java.lang.IndexOutOfBoundsException {
497         // check bounds for index
498         if (index < 0 || index >= this._mapList.size()) {
499             throw new IndexOutOfBoundsException("getMap: Index value '" + index + "' not in range [0.." + (this._mapList.size() - 1) + "]");
500         }
501         
502         return (uk.ac.vamsas.objects.core.Map) _mapList.get(index);
503     }
504
505     /**
506      * Method getMap.Returns the contents of the collection in an
507      * Array.  <p>Note:  Just in case the collection contents are
508      * changing in another thread, we pass a 0-length Array of the
509      * correct type into the API call.  This way we <i>know</i>
510      * that the Array returned is of exactly the correct length.
511      * 
512      * @return this collection as an Array
513      */
514     public uk.ac.vamsas.objects.core.Map[] getMap(
515     ) {
516         uk.ac.vamsas.objects.core.Map[] array = new uk.ac.vamsas.objects.core.Map[0];
517         return (uk.ac.vamsas.objects.core.Map[]) this._mapList.toArray(array);
518     }
519
520     /**
521      * Method getMapAsReference.Returns a reference to '_mapList'.
522      * No type checking is performed on any modifications to the
523      * Vector.
524      * 
525      * @return a reference to the Vector backing this class
526      */
527     public java.util.Vector getMapAsReference(
528     ) {
529         return this._mapList;
530     }
531
532     /**
533      * Method getMapCount.
534      * 
535      * @return the size of this collection
536      */
537     public int getMapCount(
538     ) {
539         return this._mapList.size();
540     }
541
542     /**
543      * Method getProperty.
544      * 
545      * @param index
546      * @throws java.lang.IndexOutOfBoundsException if the index
547      * given is outside the bounds of the collection
548      * @return the value of the uk.ac.vamsas.objects.core.Property
549      * at the given index
550      */
551     public uk.ac.vamsas.objects.core.Property getProperty(
552             final int index)
553     throws java.lang.IndexOutOfBoundsException {
554         // check bounds for index
555         if (index < 0 || index >= this._propertyList.size()) {
556             throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
557         }
558         
559         return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
560     }
561
562     /**
563      * Method getProperty.Returns the contents of the collection in
564      * an Array.  <p>Note:  Just in case the collection contents
565      * are changing in another thread, we pass a 0-length Array of
566      * the correct type into the API call.  This way we <i>know</i>
567      * that the Array returned is of exactly the correct length.
568      * 
569      * @return this collection as an Array
570      */
571     public uk.ac.vamsas.objects.core.Property[] getProperty(
572     ) {
573         uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
574         return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
575     }
576
577     /**
578      * Method getPropertyAsReference.Returns a reference to
579      * '_propertyList'. No type checking is performed on any
580      * modifications to the Vector.
581      * 
582      * @return a reference to the Vector backing this class
583      */
584     public java.util.Vector getPropertyAsReference(
585     ) {
586         return this._propertyList;
587     }
588
589     /**
590      * Method getPropertyCount.
591      * 
592      * @return the size of this collection
593      */
594     public int getPropertyCount(
595     ) {
596         return this._propertyList.size();
597     }
598
599     /**
600      * Returns the value of field 'source'. The field 'source' has
601      * the following description: TODO Database Naming
602      *  Convention: either start using LSID (so
603      *  change type to URI) or leave this as an
604      *  uncontrolled/unspecified string ID
605      *  
606      * 
607      * @return the value of field 'Source'.
608      */
609     public java.lang.String getSource(
610     ) {
611         return this._source;
612     }
613
614     /**
615      * Returns the value of field 'version'. The field 'version'
616      * has the following description: Version must be specified -
617      *  
618      * 
619      * @return the value of field 'Version'.
620      */
621     public java.lang.String getVersion(
622     ) {
623         return this._version;
624     }
625
626     /**
627      * Overrides the java.lang.Object.hashCode method.
628      * <p>
629      * The following steps came from <b>Effective Java Programming
630      * Language Guide</b> by Joshua Bloch, Chapter 3
631      * 
632      * @return a hash code value for the object.
633      */
634     public int hashCode(
635     ) {
636         int result = super.hashCode();
637         
638         long tmp;
639         if (_source != null
640             && !org.castor.util.CycleBreaker.startingToCycle(_source)) {
641            result = 37 * result + _source.hashCode();
642            org.castor.util.CycleBreaker.releaseCycleHandle(_source);
643         }
644         if (_version != null
645             && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
646            result = 37 * result + _version.hashCode();
647            org.castor.util.CycleBreaker.releaseCycleHandle(_version);
648         }
649         if (_accessionId != null
650             && !org.castor.util.CycleBreaker.startingToCycle(_accessionId)) {
651            result = 37 * result + _accessionId.hashCode();
652            org.castor.util.CycleBreaker.releaseCycleHandle(_accessionId);
653         }
654         if (_id != null
655             && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
656            result = 37 * result + _id.hashCode();
657            org.castor.util.CycleBreaker.releaseCycleHandle(_id);
658         }
659         if (_mapList != null
660             && !org.castor.util.CycleBreaker.startingToCycle(_mapList)) {
661            result = 37 * result + _mapList.hashCode();
662            org.castor.util.CycleBreaker.releaseCycleHandle(_mapList);
663         }
664         if (_linkList != null
665             && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) {
666            result = 37 * result + _linkList.hashCode();
667            org.castor.util.CycleBreaker.releaseCycleHandle(_linkList);
668         }
669         if (_propertyList != null
670             && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
671            result = 37 * result + _propertyList.hashCode();
672            org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
673         }
674         
675         return result;
676     }
677
678     /**
679      * Method isValid.
680      * 
681      * @return true if this object is valid according to the schema
682      */
683     public boolean isValid(
684     ) {
685         try {
686             validate();
687         } catch (org.exolab.castor.xml.ValidationException vex) {
688             return false;
689         }
690         return true;
691     }
692
693     /**
694      * 
695      * 
696      * @param out
697      * @throws org.exolab.castor.xml.MarshalException if object is
698      * null or if any SAXException is thrown during marshaling
699      * @throws org.exolab.castor.xml.ValidationException if this
700      * object is an invalid instance according to the schema
701      */
702     public void marshal(
703             final java.io.Writer out)
704     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
705         Marshaller.marshal(this, out);
706     }
707
708     /**
709      * 
710      * 
711      * @param handler
712      * @throws java.io.IOException if an IOException occurs during
713      * marshaling
714      * @throws org.exolab.castor.xml.ValidationException if this
715      * object is an invalid instance according to the schema
716      * @throws org.exolab.castor.xml.MarshalException if object is
717      * null or if any SAXException is thrown during marshaling
718      */
719     public void marshal(
720             final org.xml.sax.ContentHandler handler)
721     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
722         Marshaller.marshal(this, handler);
723     }
724
725     /**
726      */
727     public void removeAllLink(
728     ) {
729         this._linkList.clear();
730     }
731
732     /**
733      */
734     public void removeAllMap(
735     ) {
736         this._mapList.clear();
737     }
738
739     /**
740      */
741     public void removeAllProperty(
742     ) {
743         this._propertyList.clear();
744     }
745
746     /**
747      * Method removeLink.
748      * 
749      * @param vLink
750      * @return true if the object was removed from the collection.
751      */
752     public boolean removeLink(
753             final uk.ac.vamsas.objects.core.Link vLink) {
754         boolean removed = _linkList.remove(vLink);
755         return removed;
756     }
757
758     /**
759      * Method removeLinkAt.
760      * 
761      * @param index
762      * @return the element removed from the collection
763      */
764     public uk.ac.vamsas.objects.core.Link removeLinkAt(
765             final int index) {
766         java.lang.Object obj = this._linkList.remove(index);
767         return (uk.ac.vamsas.objects.core.Link) obj;
768     }
769
770     /**
771      * Method removeMap.
772      * 
773      * @param vMap
774      * @return true if the object was removed from the collection.
775      */
776     public boolean removeMap(
777             final uk.ac.vamsas.objects.core.Map vMap) {
778         boolean removed = _mapList.remove(vMap);
779         return removed;
780     }
781
782     /**
783      * Method removeMapAt.
784      * 
785      * @param index
786      * @return the element removed from the collection
787      */
788     public uk.ac.vamsas.objects.core.Map removeMapAt(
789             final int index) {
790         java.lang.Object obj = this._mapList.remove(index);
791         return (uk.ac.vamsas.objects.core.Map) obj;
792     }
793
794     /**
795      * Method removeProperty.
796      * 
797      * @param vProperty
798      * @return true if the object was removed from the collection.
799      */
800     public boolean removeProperty(
801             final uk.ac.vamsas.objects.core.Property vProperty) {
802         boolean removed = _propertyList.remove(vProperty);
803         return removed;
804     }
805
806     /**
807      * Method removePropertyAt.
808      * 
809      * @param index
810      * @return the element removed from the collection
811      */
812     public uk.ac.vamsas.objects.core.Property removePropertyAt(
813             final int index) {
814         java.lang.Object obj = this._propertyList.remove(index);
815         return (uk.ac.vamsas.objects.core.Property) obj;
816     }
817
818     /**
819      * Sets the value of field 'accessionId'. The field
820      * 'accessionId' has the following description: TODO: make some
821      * specification
822      *  of the database field from which this
823      *  accessionId is taken from - should that be a
824      *  special property of the dbRef object ?
825      *  
826      * 
827      * @param accessionId the value of field 'accessionId'.
828      */
829     public void setAccessionId(
830             final java.lang.String accessionId) {
831         this._accessionId = accessionId;
832     }
833
834     /**
835      * Sets the value of field 'id'. The field 'id' has the
836      * following description: Primary Key for vamsas object
837      *  referencing 
838      * 
839      * @param id the value of field 'id'.
840      */
841     public void setId(
842             final java.lang.String id) {
843         this._id = id;
844     }
845
846     /**
847      * 
848      * 
849      * @param index
850      * @param vLink
851      * @throws java.lang.IndexOutOfBoundsException if the index
852      * given is outside the bounds of the collection
853      */
854     public void setLink(
855             final int index,
856             final uk.ac.vamsas.objects.core.Link vLink)
857     throws java.lang.IndexOutOfBoundsException {
858         // check bounds for index
859         if (index < 0 || index >= this._linkList.size()) {
860             throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
861         }
862         
863         this._linkList.set(index, vLink);
864     }
865
866     /**
867      * 
868      * 
869      * @param vLinkArray
870      */
871     public void setLink(
872             final uk.ac.vamsas.objects.core.Link[] vLinkArray) {
873         //-- copy array
874         _linkList.clear();
875         
876         for (int i = 0; i < vLinkArray.length; i++) {
877                 this._linkList.add(vLinkArray[i]);
878         }
879     }
880
881     /**
882      * Sets the value of '_linkList' by copying the given Vector.
883      * All elements will be checked for type safety.
884      * 
885      * @param vLinkList the Vector to copy.
886      */
887     public void setLink(
888             final java.util.Vector vLinkList) {
889         // copy vector
890         this._linkList.clear();
891         
892         this._linkList.addAll(vLinkList);
893     }
894
895     /**
896      * Sets the value of '_linkList' by setting it to the given
897      * Vector. No type checking is performed.
898      * @deprecated
899      * 
900      * @param linkVector the Vector to set.
901      */
902     public void setLinkAsReference(
903             final java.util.Vector linkVector) {
904         this._linkList = linkVector;
905     }
906
907     /**
908      * 
909      * 
910      * @param index
911      * @param vMap
912      * @throws java.lang.IndexOutOfBoundsException if the index
913      * given is outside the bounds of the collection
914      */
915     public void setMap(
916             final int index,
917             final uk.ac.vamsas.objects.core.Map vMap)
918     throws java.lang.IndexOutOfBoundsException {
919         // check bounds for index
920         if (index < 0 || index >= this._mapList.size()) {
921             throw new IndexOutOfBoundsException("setMap: Index value '" + index + "' not in range [0.." + (this._mapList.size() - 1) + "]");
922         }
923         
924         this._mapList.set(index, vMap);
925     }
926
927     /**
928      * 
929      * 
930      * @param vMapArray
931      */
932     public void setMap(
933             final uk.ac.vamsas.objects.core.Map[] vMapArray) {
934         //-- copy array
935         _mapList.clear();
936         
937         for (int i = 0; i < vMapArray.length; i++) {
938                 this._mapList.add(vMapArray[i]);
939         }
940     }
941
942     /**
943      * Sets the value of '_mapList' by copying the given Vector.
944      * All elements will be checked for type safety.
945      * 
946      * @param vMapList the Vector to copy.
947      */
948     public void setMap(
949             final java.util.Vector vMapList) {
950         // copy vector
951         this._mapList.clear();
952         
953         this._mapList.addAll(vMapList);
954     }
955
956     /**
957      * Sets the value of '_mapList' by setting it to the given
958      * Vector. No type checking is performed.
959      * @deprecated
960      * 
961      * @param mapVector the Vector to set.
962      */
963     public void setMapAsReference(
964             final java.util.Vector mapVector) {
965         this._mapList = mapVector;
966     }
967
968     /**
969      * 
970      * 
971      * @param index
972      * @param vProperty
973      * @throws java.lang.IndexOutOfBoundsException if the index
974      * given is outside the bounds of the collection
975      */
976     public void setProperty(
977             final int index,
978             final uk.ac.vamsas.objects.core.Property vProperty)
979     throws java.lang.IndexOutOfBoundsException {
980         // check bounds for index
981         if (index < 0 || index >= this._propertyList.size()) {
982             throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
983         }
984         
985         this._propertyList.set(index, vProperty);
986     }
987
988     /**
989      * 
990      * 
991      * @param vPropertyArray
992      */
993     public void setProperty(
994             final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
995         //-- copy array
996         _propertyList.clear();
997         
998         for (int i = 0; i < vPropertyArray.length; i++) {
999                 this._propertyList.add(vPropertyArray[i]);
1000         }
1001     }
1002
1003     /**
1004      * Sets the value of '_propertyList' by copying the given
1005      * Vector. All elements will be checked for type safety.
1006      * 
1007      * @param vPropertyList the Vector to copy.
1008      */
1009     public void setProperty(
1010             final java.util.Vector vPropertyList) {
1011         // copy vector
1012         this._propertyList.clear();
1013         
1014         this._propertyList.addAll(vPropertyList);
1015     }
1016
1017     /**
1018      * Sets the value of '_propertyList' by setting it to the given
1019      * Vector. No type checking is performed.
1020      * @deprecated
1021      * 
1022      * @param propertyVector the Vector to set.
1023      */
1024     public void setPropertyAsReference(
1025             final java.util.Vector propertyVector) {
1026         this._propertyList = propertyVector;
1027     }
1028
1029     /**
1030      * Sets the value of field 'source'. The field 'source' has the
1031      * following description: TODO Database Naming
1032      *  Convention: either start using LSID (so
1033      *  change type to URI) or leave this as an
1034      *  uncontrolled/unspecified string ID
1035      *  
1036      * 
1037      * @param source the value of field 'source'.
1038      */
1039     public void setSource(
1040             final java.lang.String source) {
1041         this._source = source;
1042     }
1043
1044     /**
1045      * Sets the value of field 'version'. The field 'version' has
1046      * the following description: Version must be specified -
1047      *  
1048      * 
1049      * @param version the value of field 'version'.
1050      */
1051     public void setVersion(
1052             final java.lang.String version) {
1053         this._version = version;
1054     }
1055
1056     /**
1057      * Method unmarshal.
1058      * 
1059      * @param reader
1060      * @throws org.exolab.castor.xml.MarshalException if object is
1061      * null or if any SAXException is thrown during marshaling
1062      * @throws org.exolab.castor.xml.ValidationException if this
1063      * object is an invalid instance according to the schema
1064      * @return the unmarshaled uk.ac.vamsas.objects.core.DbRef
1065      */
1066     public static uk.ac.vamsas.objects.core.DbRef unmarshal(
1067             final java.io.Reader reader)
1068     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1069         return (uk.ac.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DbRef.class, reader);
1070     }
1071
1072     /**
1073      * 
1074      * 
1075      * @throws org.exolab.castor.xml.ValidationException if this
1076      * object is an invalid instance according to the schema
1077      */
1078     public void validate(
1079     )
1080     throws org.exolab.castor.xml.ValidationException {
1081         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1082         validator.validate(this);
1083     }
1084
1085 }