refactored org to uk
[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:SequenceType.java 264 2006-12-14 17:42:54Z JimP $
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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $
30  */
31 public class SequenceType extends uk.ac.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     private java.util.Vector _propertyList;
79
80     /**
81      * Field _mappingList
82      */
83     private java.util.Vector _mappingList;
84
85
86       //----------------/
87      //- Constructors -/
88     //----------------/
89
90     public SequenceType() 
91      {
92         super();
93         _propertyList = new Vector();
94         _mappingList = new Vector();
95     } //-- org.vamsas.objects.core.SequenceType()
96
97
98       //-----------/
99      //- Methods -/
100     //-----------/
101
102     /**
103      * Method addMapping
104      * 
105      * 
106      * 
107      * @param vMapping
108      */
109     public void addMapping(org.vamsas.objects.core.Mapping vMapping)
110         throws java.lang.IndexOutOfBoundsException
111     {
112         _mappingList.addElement(vMapping);
113     } //-- void addMapping(org.vamsas.objects.core.Mapping) 
114
115     /**
116      * Method addMapping
117      * 
118      * 
119      * 
120      * @param index
121      * @param vMapping
122      */
123     public void addMapping(int index, org.vamsas.objects.core.Mapping vMapping)
124         throws java.lang.IndexOutOfBoundsException
125     {
126         _mappingList.insertElementAt(vMapping, index);
127     } //-- void addMapping(int, org.vamsas.objects.core.Mapping) 
128
129     /**
130      * Method addProperty
131      * 
132      * 
133      * 
134      * @param vProperty
135      */
136     public void addProperty(org.vamsas.objects.core.Property vProperty)
137         throws java.lang.IndexOutOfBoundsException
138     {
139         _propertyList.addElement(vProperty);
140     } //-- void addProperty(org.vamsas.objects.core.Property) 
141
142     /**
143      * Method addProperty
144      * 
145      * 
146      * 
147      * @param index
148      * @param vProperty
149      */
150     public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
151         throws java.lang.IndexOutOfBoundsException
152     {
153         _propertyList.insertElementAt(vProperty, index);
154     } //-- void addProperty(int, org.vamsas.objects.core.Property) 
155
156     /**
157      * Method deleteEnd
158      * 
159      */
160     public void deleteEnd()
161     {
162         this._has_end= false;
163     } //-- void deleteEnd() 
164
165     /**
166      * Method deleteStart
167      * 
168      */
169     public void deleteStart()
170     {
171         this._has_start= false;
172     } //-- void deleteStart() 
173
174     /**
175      * Method enumerateMapping
176      * 
177      * 
178      * 
179      * @return Enumeration
180      */
181     public java.util.Enumeration enumerateMapping()
182     {
183         return _mappingList.elements();
184     } //-- java.util.Enumeration enumerateMapping() 
185
186     /**
187      * Method enumerateProperty
188      * 
189      * 
190      * 
191      * @return Enumeration
192      */
193     public java.util.Enumeration enumerateProperty()
194     {
195         return _propertyList.elements();
196     } //-- java.util.Enumeration enumerateProperty() 
197
198     /**
199      * Note: hashCode() has not been overriden
200      * 
201      * @param obj
202      * @return boolean
203      */
204     public boolean equals(java.lang.Object obj)
205     {
206         if ( this == obj )
207             return true;
208         
209         if (super.equals(obj)==false)
210             return false;
211         
212         if (obj instanceof SequenceType) {
213         
214             SequenceType temp = (SequenceType)obj;
215             if (this._start != temp._start)
216                 return false;
217             if (this._has_start != temp._has_start)
218                 return false;
219             if (this._end != temp._end)
220                 return false;
221             if (this._has_end != temp._has_end)
222                 return false;
223             if (this._sequence != null) {
224                 if (temp._sequence == null) return false;
225                 else if (!(this._sequence.equals(temp._sequence))) 
226                     return false;
227             }
228             else if (temp._sequence != null)
229                 return false;
230             if (this._name != null) {
231                 if (temp._name == null) return false;
232                 else if (!(this._name.equals(temp._name))) 
233                     return false;
234             }
235             else if (temp._name != null)
236                 return false;
237             if (this._description != null) {
238                 if (temp._description == null) return false;
239                 else if (!(this._description.equals(temp._description))) 
240                     return false;
241             }
242             else if (temp._description != null)
243                 return false;
244             if (this._propertyList != null) {
245                 if (temp._propertyList == null) return false;
246                 else if (!(this._propertyList.equals(temp._propertyList))) 
247                     return false;
248             }
249             else if (temp._propertyList != null)
250                 return false;
251             if (this._mappingList != null) {
252                 if (temp._mappingList == null) return false;
253                 else if (!(this._mappingList.equals(temp._mappingList))) 
254                     return false;
255             }
256             else if (temp._mappingList != null)
257                 return false;
258             return true;
259         }
260         return false;
261     } //-- boolean equals(java.lang.Object) 
262
263     /**
264      * Returns the value of field 'description'.
265      * 
266      * @return String
267      * @return the value of field 'description'.
268      */
269     public java.lang.String getDescription()
270     {
271         return this._description;
272     } //-- java.lang.String getDescription() 
273
274     /**
275      * Returns the value of field 'end'.
276      * 
277      * @return int
278      * @return the value of field 'end'.
279      */
280     public int getEnd()
281     {
282         return this._end;
283     } //-- int getEnd() 
284
285     /**
286      * Method getMapping
287      * 
288      * 
289      * 
290      * @param index
291      * @return Mapping
292      */
293     public org.vamsas.objects.core.Mapping getMapping(int index)
294         throws java.lang.IndexOutOfBoundsException
295     {
296         //-- check bounds for index
297         if ((index < 0) || (index > _mappingList.size())) {
298             throw new IndexOutOfBoundsException("getMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]");
299         }
300         
301         return (org.vamsas.objects.core.Mapping) _mappingList.elementAt(index);
302     } //-- org.vamsas.objects.core.Mapping getMapping(int) 
303
304     /**
305      * Method getMapping
306      * 
307      * 
308      * 
309      * @return Mapping
310      */
311     public org.vamsas.objects.core.Mapping[] getMapping()
312     {
313         int size = _mappingList.size();
314         org.vamsas.objects.core.Mapping[] mArray = new org.vamsas.objects.core.Mapping[size];
315         for (int index = 0; index < size; index++) {
316             mArray[index] = (org.vamsas.objects.core.Mapping) _mappingList.elementAt(index);
317         }
318         return mArray;
319     } //-- org.vamsas.objects.core.Mapping[] getMapping() 
320
321     /**
322      * Method getMappingCount
323      * 
324      * 
325      * 
326      * @return int
327      */
328     public int getMappingCount()
329     {
330         return _mappingList.size();
331     } //-- int getMappingCount() 
332
333     /**
334      * Returns the value of field 'name'.
335      * 
336      * @return String
337      * @return the value of field 'name'.
338      */
339     public java.lang.String getName()
340     {
341         return this._name;
342     } //-- java.lang.String getName() 
343
344     /**
345      * Method getProperty
346      * 
347      * 
348      * 
349      * @param index
350      * @return Property
351      */
352     public org.vamsas.objects.core.Property getProperty(int index)
353         throws java.lang.IndexOutOfBoundsException
354     {
355         //-- check bounds for index
356         if ((index < 0) || (index > _propertyList.size())) {
357             throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
358         }
359         
360         return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
361     } //-- org.vamsas.objects.core.Property getProperty(int) 
362
363     /**
364      * Method getProperty
365      * 
366      * 
367      * 
368      * @return Property
369      */
370     public org.vamsas.objects.core.Property[] getProperty()
371     {
372         int size = _propertyList.size();
373         org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
374         for (int index = 0; index < size; index++) {
375             mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
376         }
377         return mArray;
378     } //-- org.vamsas.objects.core.Property[] getProperty() 
379
380     /**
381      * Method getPropertyCount
382      * 
383      * 
384      * 
385      * @return int
386      */
387     public int getPropertyCount()
388     {
389         return _propertyList.size();
390     } //-- int getPropertyCount() 
391
392     /**
393      * Returns the value of field 'sequence'.
394      * 
395      * @return String
396      * @return the value of field 'sequence'.
397      */
398     public java.lang.String getSequence()
399     {
400         return this._sequence;
401     } //-- java.lang.String getSequence() 
402
403     /**
404      * Returns the value of field 'start'.
405      * 
406      * @return int
407      * @return the value of field 'start'.
408      */
409     public int getStart()
410     {
411         return this._start;
412     } //-- int getStart() 
413
414     /**
415      * Method hasEnd
416      * 
417      * 
418      * 
419      * @return boolean
420      */
421     public boolean hasEnd()
422     {
423         return this._has_end;
424     } //-- boolean hasEnd() 
425
426     /**
427      * Method hasStart
428      * 
429      * 
430      * 
431      * @return boolean
432      */
433     public boolean hasStart()
434     {
435         return this._has_start;
436     } //-- boolean hasStart() 
437
438     /**
439      * Method isValid
440      * 
441      * 
442      * 
443      * @return boolean
444      */
445     public boolean isValid()
446     {
447         try {
448             validate();
449         }
450         catch (org.exolab.castor.xml.ValidationException vex) {
451             return false;
452         }
453         return true;
454     } //-- boolean isValid() 
455
456     /**
457      * Method marshal
458      * 
459      * 
460      * 
461      * @param out
462      */
463     public void marshal(java.io.Writer out)
464         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
465     {
466         
467         Marshaller.marshal(this, out);
468     } //-- void marshal(java.io.Writer) 
469
470     /**
471      * Method marshal
472      * 
473      * 
474      * 
475      * @param handler
476      */
477     public void marshal(org.xml.sax.ContentHandler handler)
478         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
479     {
480         
481         Marshaller.marshal(this, handler);
482     } //-- void marshal(org.xml.sax.ContentHandler) 
483
484     /**
485      * Method removeAllMapping
486      * 
487      */
488     public void removeAllMapping()
489     {
490         _mappingList.removeAllElements();
491     } //-- void removeAllMapping() 
492
493     /**
494      * Method removeAllProperty
495      * 
496      */
497     public void removeAllProperty()
498     {
499         _propertyList.removeAllElements();
500     } //-- void removeAllProperty() 
501
502     /**
503      * Method removeMapping
504      * 
505      * 
506      * 
507      * @param index
508      * @return Mapping
509      */
510     public org.vamsas.objects.core.Mapping removeMapping(int index)
511     {
512         java.lang.Object obj = _mappingList.elementAt(index);
513         _mappingList.removeElementAt(index);
514         return (org.vamsas.objects.core.Mapping) obj;
515     } //-- org.vamsas.objects.core.Mapping removeMapping(int) 
516
517     /**
518      * Method removeProperty
519      * 
520      * 
521      * 
522      * @param index
523      * @return Property
524      */
525     public org.vamsas.objects.core.Property removeProperty(int index)
526     {
527         java.lang.Object obj = _propertyList.elementAt(index);
528         _propertyList.removeElementAt(index);
529         return (org.vamsas.objects.core.Property) obj;
530     } //-- org.vamsas.objects.core.Property removeProperty(int) 
531
532     /**
533      * Sets the value of field 'description'.
534      * 
535      * @param description the value of field 'description'.
536      */
537     public void setDescription(java.lang.String description)
538     {
539         this._description = description;
540     } //-- void setDescription(java.lang.String) 
541
542     /**
543      * Sets the value of field 'end'.
544      * 
545      * @param end the value of field 'end'.
546      */
547     public void setEnd(int end)
548     {
549         this._end = end;
550         this._has_end = true;
551     } //-- void setEnd(int) 
552
553     /**
554      * Method setMapping
555      * 
556      * 
557      * 
558      * @param index
559      * @param vMapping
560      */
561     public void setMapping(int index, org.vamsas.objects.core.Mapping vMapping)
562         throws java.lang.IndexOutOfBoundsException
563     {
564         //-- check bounds for index
565         if ((index < 0) || (index > _mappingList.size())) {
566             throw new IndexOutOfBoundsException("setMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]");
567         }
568         _mappingList.setElementAt(vMapping, index);
569     } //-- void setMapping(int, org.vamsas.objects.core.Mapping) 
570
571     /**
572      * Method setMapping
573      * 
574      * 
575      * 
576      * @param mappingArray
577      */
578     public void setMapping(org.vamsas.objects.core.Mapping[] mappingArray)
579     {
580         //-- copy array
581         _mappingList.removeAllElements();
582         for (int i = 0; i < mappingArray.length; i++) {
583             _mappingList.addElement(mappingArray[i]);
584         }
585     } //-- void setMapping(org.vamsas.objects.core.Mapping) 
586
587     /**
588      * Sets the value of field 'name'.
589      * 
590      * @param name the value of field 'name'.
591      */
592     public void setName(java.lang.String name)
593     {
594         this._name = name;
595     } //-- void setName(java.lang.String) 
596
597     /**
598      * Method setProperty
599      * 
600      * 
601      * 
602      * @param index
603      * @param vProperty
604      */
605     public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
606         throws java.lang.IndexOutOfBoundsException
607     {
608         //-- check bounds for index
609         if ((index < 0) || (index > _propertyList.size())) {
610             throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
611         }
612         _propertyList.setElementAt(vProperty, index);
613     } //-- void setProperty(int, org.vamsas.objects.core.Property) 
614
615     /**
616      * Method setProperty
617      * 
618      * 
619      * 
620      * @param propertyArray
621      */
622     public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
623     {
624         //-- copy array
625         _propertyList.removeAllElements();
626         for (int i = 0; i < propertyArray.length; i++) {
627             _propertyList.addElement(propertyArray[i]);
628         }
629     } //-- void setProperty(org.vamsas.objects.core.Property) 
630
631     /**
632      * Sets the value of field 'sequence'.
633      * 
634      * @param sequence the value of field 'sequence'.
635      */
636     public void setSequence(java.lang.String sequence)
637     {
638         this._sequence = sequence;
639     } //-- void setSequence(java.lang.String) 
640
641     /**
642      * Sets the value of field 'start'.
643      * 
644      * @param start the value of field 'start'.
645      */
646     public void setStart(int start)
647     {
648         this._start = start;
649         this._has_start = true;
650     } //-- void setStart(int) 
651
652     /**
653      * Method unmarshal
654      * 
655      * 
656      * 
657      * @param reader
658      * @return SequenceType
659      */
660     public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
661         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
662     {
663         return (org.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceType.class, reader);
664     } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader) 
665
666     /**
667      * Method validate
668      * 
669      */
670     public void validate()
671         throws org.exolab.castor.xml.ValidationException
672     {
673         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
674         validator.validate(this);
675     } //-- void validate() 
676
677 }