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