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