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