e6204d6c873ffa58b6ad7a70740eb7be66bc70ff
[vamsas.git] / src / org / vamsas / objects / core / SequenceType.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  * Class SequenceType.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class SequenceType extends org.vamsas.client.object 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _start
42      */
43     private int _start;
44
45     /**
46      * keeps track of state for field: _start
47      */
48     private boolean _has_start;
49
50     /**
51      * Field _end
52      */
53     private int _end;
54
55     /**
56      * keeps track of state for field: _end
57      */
58     private boolean _has_end;
59
60     /**
61      * Field _id
62      */
63     private java.lang.String _id;
64
65     /**
66      * Field _sequence
67      */
68     private java.lang.String _sequence;
69
70     /**
71      * Field _name
72      */
73     private java.lang.String _name;
74
75     /**
76      * Field _dbRefList
77      */
78     private java.util.Vector _dbRefList;
79
80
81       //----------------/
82      //- Constructors -/
83     //----------------/
84
85     public SequenceType() 
86      {
87         super();
88         _dbRefList = new Vector();
89     } //-- org.vamsas.objects.core.SequenceType()
90
91
92       //-----------/
93      //- Methods -/
94     //-----------/
95
96     /**
97      * Method addDbRef
98      * 
99      * 
100      * 
101      * @param vDbRef
102      */
103     public void addDbRef(org.vamsas.objects.core.DbRef vDbRef)
104         throws java.lang.IndexOutOfBoundsException
105     {
106         _dbRefList.addElement(vDbRef);
107     } //-- void addDbRef(org.vamsas.objects.core.DbRef) 
108
109     /**
110      * Method addDbRef
111      * 
112      * 
113      * 
114      * @param index
115      * @param vDbRef
116      */
117     public void addDbRef(int index, org.vamsas.objects.core.DbRef vDbRef)
118         throws java.lang.IndexOutOfBoundsException
119     {
120         _dbRefList.insertElementAt(vDbRef, index);
121     } //-- void addDbRef(int, org.vamsas.objects.core.DbRef) 
122
123     /**
124      * Method deleteEnd
125      * 
126      */
127     public void deleteEnd()
128     {
129         this._has_end= false;
130     } //-- void deleteEnd() 
131
132     /**
133      * Method deleteStart
134      * 
135      */
136     public void deleteStart()
137     {
138         this._has_start= false;
139     } //-- void deleteStart() 
140
141     /**
142      * Method enumerateDbRef
143      * 
144      * 
145      * 
146      * @return Enumeration
147      */
148     public java.util.Enumeration enumerateDbRef()
149     {
150         return _dbRefList.elements();
151     } //-- java.util.Enumeration enumerateDbRef() 
152
153     /**
154      * Note: hashCode() has not been overriden
155      * 
156      * @param obj
157      * @return boolean
158      */
159     public boolean equals(java.lang.Object obj)
160     {
161         if ( this == obj )
162             return true;
163         
164         if (super.equals(obj)==false)
165             return false;
166         
167         if (obj instanceof SequenceType) {
168         
169             SequenceType temp = (SequenceType)obj;
170             if (this._start != temp._start)
171                 return false;
172             if (this._has_start != temp._has_start)
173                 return false;
174             if (this._end != temp._end)
175                 return false;
176             if (this._has_end != temp._has_end)
177                 return false;
178             if (this._id != null) {
179                 if (temp._id == null) return false;
180                 else if (!(this._id.equals(temp._id))) 
181                     return false;
182             }
183             else if (temp._id != null)
184                 return false;
185             if (this._sequence != null) {
186                 if (temp._sequence == null) return false;
187                 else if (!(this._sequence.equals(temp._sequence))) 
188                     return false;
189             }
190             else if (temp._sequence != null)
191                 return false;
192             if (this._name != null) {
193                 if (temp._name == null) return false;
194                 else if (!(this._name.equals(temp._name))) 
195                     return false;
196             }
197             else if (temp._name != null)
198                 return false;
199             if (this._dbRefList != null) {
200                 if (temp._dbRefList == null) return false;
201                 else if (!(this._dbRefList.equals(temp._dbRefList))) 
202                     return false;
203             }
204             else if (temp._dbRefList != null)
205                 return false;
206             return true;
207         }
208         return false;
209     } //-- boolean equals(java.lang.Object) 
210
211     /**
212      * Method getDbRef
213      * 
214      * 
215      * 
216      * @param index
217      * @return DbRef
218      */
219     public org.vamsas.objects.core.DbRef getDbRef(int index)
220         throws java.lang.IndexOutOfBoundsException
221     {
222         //-- check bounds for index
223         if ((index < 0) || (index > _dbRefList.size())) {
224             throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
225         }
226         
227         return (org.vamsas.objects.core.DbRef) _dbRefList.elementAt(index);
228     } //-- org.vamsas.objects.core.DbRef getDbRef(int) 
229
230     /**
231      * Method getDbRef
232      * 
233      * 
234      * 
235      * @return DbRef
236      */
237     public org.vamsas.objects.core.DbRef[] getDbRef()
238     {
239         int size = _dbRefList.size();
240         org.vamsas.objects.core.DbRef[] mArray = new org.vamsas.objects.core.DbRef[size];
241         for (int index = 0; index < size; index++) {
242             mArray[index] = (org.vamsas.objects.core.DbRef) _dbRefList.elementAt(index);
243         }
244         return mArray;
245     } //-- org.vamsas.objects.core.DbRef[] getDbRef() 
246
247     /**
248      * Method getDbRefCount
249      * 
250      * 
251      * 
252      * @return int
253      */
254     public int getDbRefCount()
255     {
256         return _dbRefList.size();
257     } //-- int getDbRefCount() 
258
259     /**
260      * Returns the value of field 'end'.
261      * 
262      * @return int
263      * @return the value of field 'end'.
264      */
265     public int getEnd()
266     {
267         return this._end;
268     } //-- int getEnd() 
269
270     /**
271      * Returns the value of field 'id'.
272      * 
273      * @return String
274      * @return the value of field 'id'.
275      */
276     public java.lang.String getId()
277     {
278         return this._id;
279     } //-- java.lang.String getId() 
280
281     /**
282      * Returns the value of field 'name'.
283      * 
284      * @return String
285      * @return the value of field 'name'.
286      */
287     public java.lang.String getName()
288     {
289         return this._name;
290     } //-- java.lang.String getName() 
291
292     /**
293      * Returns the value of field 'sequence'.
294      * 
295      * @return String
296      * @return the value of field 'sequence'.
297      */
298     public java.lang.String getSequence()
299     {
300         return this._sequence;
301     } //-- java.lang.String getSequence() 
302
303     /**
304      * Returns the value of field 'start'.
305      * 
306      * @return int
307      * @return the value of field 'start'.
308      */
309     public int getStart()
310     {
311         return this._start;
312     } //-- int getStart() 
313
314     /**
315      * Method hasEnd
316      * 
317      * 
318      * 
319      * @return boolean
320      */
321     public boolean hasEnd()
322     {
323         return this._has_end;
324     } //-- boolean hasEnd() 
325
326     /**
327      * Method hasStart
328      * 
329      * 
330      * 
331      * @return boolean
332      */
333     public boolean hasStart()
334     {
335         return this._has_start;
336     } //-- boolean hasStart() 
337
338     /**
339      * Method isValid
340      * 
341      * 
342      * 
343      * @return boolean
344      */
345     public boolean isValid()
346     {
347         try {
348             validate();
349         }
350         catch (org.exolab.castor.xml.ValidationException vex) {
351             return false;
352         }
353         return true;
354     } //-- boolean isValid() 
355
356     /**
357      * Method marshal
358      * 
359      * 
360      * 
361      * @param out
362      */
363     public void marshal(java.io.Writer out)
364         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
365     {
366         
367         Marshaller.marshal(this, out);
368     } //-- void marshal(java.io.Writer) 
369
370     /**
371      * Method marshal
372      * 
373      * 
374      * 
375      * @param handler
376      */
377     public void marshal(org.xml.sax.ContentHandler handler)
378         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
379     {
380         
381         Marshaller.marshal(this, handler);
382     } //-- void marshal(org.xml.sax.ContentHandler) 
383
384     /**
385      * Method removeAllDbRef
386      * 
387      */
388     public void removeAllDbRef()
389     {
390         _dbRefList.removeAllElements();
391     } //-- void removeAllDbRef() 
392
393     /**
394      * Method removeDbRef
395      * 
396      * 
397      * 
398      * @param index
399      * @return DbRef
400      */
401     public org.vamsas.objects.core.DbRef removeDbRef(int index)
402     {
403         java.lang.Object obj = _dbRefList.elementAt(index);
404         _dbRefList.removeElementAt(index);
405         return (org.vamsas.objects.core.DbRef) obj;
406     } //-- org.vamsas.objects.core.DbRef removeDbRef(int) 
407
408     /**
409      * Method setDbRef
410      * 
411      * 
412      * 
413      * @param index
414      * @param vDbRef
415      */
416     public void setDbRef(int index, org.vamsas.objects.core.DbRef vDbRef)
417         throws java.lang.IndexOutOfBoundsException
418     {
419         //-- check bounds for index
420         if ((index < 0) || (index > _dbRefList.size())) {
421             throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
422         }
423         _dbRefList.setElementAt(vDbRef, index);
424     } //-- void setDbRef(int, org.vamsas.objects.core.DbRef) 
425
426     /**
427      * Method setDbRef
428      * 
429      * 
430      * 
431      * @param dbRefArray
432      */
433     public void setDbRef(org.vamsas.objects.core.DbRef[] dbRefArray)
434     {
435         //-- copy array
436         _dbRefList.removeAllElements();
437         for (int i = 0; i < dbRefArray.length; i++) {
438             _dbRefList.addElement(dbRefArray[i]);
439         }
440     } //-- void setDbRef(org.vamsas.objects.core.DbRef) 
441
442     /**
443      * Sets the value of field 'end'.
444      * 
445      * @param end the value of field 'end'.
446      */
447     public void setEnd(int end)
448     {
449         this._end = end;
450         this._has_end = true;
451     } //-- void setEnd(int) 
452
453     /**
454      * Sets the value of field 'id'.
455      * 
456      * @param id the value of field 'id'.
457      */
458     public void setId(java.lang.String id)
459     {
460         this._id = id;
461     } //-- void setId(java.lang.String) 
462
463     /**
464      * Sets the value of field 'name'.
465      * 
466      * @param name the value of field 'name'.
467      */
468     public void setName(java.lang.String name)
469     {
470         this._name = name;
471     } //-- void setName(java.lang.String) 
472
473     /**
474      * Sets the value of field 'sequence'.
475      * 
476      * @param sequence the value of field 'sequence'.
477      */
478     public void setSequence(java.lang.String sequence)
479     {
480         this._sequence = sequence;
481     } //-- void setSequence(java.lang.String) 
482
483     /**
484      * Sets the value of field 'start'.
485      * 
486      * @param start the value of field 'start'.
487      */
488     public void setStart(int start)
489     {
490         this._start = start;
491         this._has_start = true;
492     } //-- void setStart(int) 
493
494     /**
495      * Method unmarshal
496      * 
497      * 
498      * 
499      * @param reader
500      * @return SequenceType
501      */
502     public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
503         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
504     {
505         return (org.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceType.class, reader);
506     } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader) 
507
508     /**
509      * Method validate
510      * 
511      */
512     public void validate()
513         throws org.exolab.castor.xml.ValidationException
514     {
515         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
516         validator.validate(this);
517     } //-- void validate() 
518
519 }