autogenerated java classes for current schema
[vamsas.git] / src / org / vamsas / objects / core / AlignmentSequence.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 AlignmentSequence.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class AlignmentSequence extends org.vamsas.objects.core.SequenceType 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Primary Key for
42      *  vamsas object
43      *  referencing
44      *  
45      */
46     private java.lang.String _id;
47
48     /**
49      * Dataset Sequence
50      *  from which this
51      *  alignment
52      *  sequence is
53      *  taken from
54      *  
55      */
56     private java.lang.Object _refid;
57
58     /**
59      * Field _alignmentSequenceAnnotationList
60      */
61     private java.util.Vector _alignmentSequenceAnnotationList;
62
63
64       //----------------/
65      //- Constructors -/
66     //----------------/
67
68     public AlignmentSequence() 
69      {
70         super();
71         _alignmentSequenceAnnotationList = new Vector();
72     } //-- org.vamsas.objects.core.AlignmentSequence()
73
74
75       //-----------/
76      //- Methods -/
77     //-----------/
78
79     /**
80      * Method addAlignmentSequenceAnnotation
81      * 
82      * 
83      * 
84      * @param vAlignmentSequenceAnnotation
85      */
86     public void addAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
87         throws java.lang.IndexOutOfBoundsException
88     {
89         _alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation);
90     } //-- void addAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation) 
91
92     /**
93      * Method addAlignmentSequenceAnnotation
94      * 
95      * 
96      * 
97      * @param index
98      * @param vAlignmentSequenceAnnotation
99      */
100     public void addAlignmentSequenceAnnotation(int index, org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
101         throws java.lang.IndexOutOfBoundsException
102     {
103         _alignmentSequenceAnnotationList.insertElementAt(vAlignmentSequenceAnnotation, index);
104     } //-- void addAlignmentSequenceAnnotation(int, org.vamsas.objects.core.AlignmentSequenceAnnotation) 
105
106     /**
107      * Method enumerateAlignmentSequenceAnnotation
108      * 
109      * 
110      * 
111      * @return Enumeration
112      */
113     public java.util.Enumeration enumerateAlignmentSequenceAnnotation()
114     {
115         return _alignmentSequenceAnnotationList.elements();
116     } //-- java.util.Enumeration enumerateAlignmentSequenceAnnotation() 
117
118     /**
119      * Note: hashCode() has not been overriden
120      * 
121      * @param obj
122      * @return boolean
123      */
124     public boolean equals(java.lang.Object obj)
125     {
126         if ( this == obj )
127             return true;
128         
129         if (super.equals(obj)==false)
130             return false;
131         
132         if (obj instanceof AlignmentSequence) {
133         
134             AlignmentSequence temp = (AlignmentSequence)obj;
135             if (this._id != null) {
136                 if (temp._id == null) return false;
137                 else if (!(this._id.equals(temp._id))) 
138                     return false;
139             }
140             else if (temp._id != null)
141                 return false;
142             if (this._refid != null) {
143                 if (temp._refid == null) return false;
144                 else if (!(this._refid.equals(temp._refid))) 
145                     return false;
146             }
147             else if (temp._refid != null)
148                 return false;
149             if (this._alignmentSequenceAnnotationList != null) {
150                 if (temp._alignmentSequenceAnnotationList == null) return false;
151                 else if (!(this._alignmentSequenceAnnotationList.equals(temp._alignmentSequenceAnnotationList))) 
152                     return false;
153             }
154             else if (temp._alignmentSequenceAnnotationList != null)
155                 return false;
156             return true;
157         }
158         return false;
159     } //-- boolean equals(java.lang.Object) 
160
161     /**
162      * Method getAlignmentSequenceAnnotation
163      * 
164      * 
165      * 
166      * @param index
167      * @return AlignmentSequenceAnnotation
168      */
169     public org.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int index)
170         throws java.lang.IndexOutOfBoundsException
171     {
172         //-- check bounds for index
173         if ((index < 0) || (index > _alignmentSequenceAnnotationList.size())) {
174             throw new IndexOutOfBoundsException("getAlignmentSequenceAnnotation: Index value '"+index+"' not in range [0.."+_alignmentSequenceAnnotationList.size()+ "]");
175         }
176         
177         return (org.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index);
178     } //-- org.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int) 
179
180     /**
181      * Method getAlignmentSequenceAnnotation
182      * 
183      * 
184      * 
185      * @return AlignmentSequenceAnnotation
186      */
187     public org.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation()
188     {
189         int size = _alignmentSequenceAnnotationList.size();
190         org.vamsas.objects.core.AlignmentSequenceAnnotation[] mArray = new org.vamsas.objects.core.AlignmentSequenceAnnotation[size];
191         for (int index = 0; index < size; index++) {
192             mArray[index] = (org.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index);
193         }
194         return mArray;
195     } //-- org.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() 
196
197     /**
198      * Method getAlignmentSequenceAnnotationCount
199      * 
200      * 
201      * 
202      * @return int
203      */
204     public int getAlignmentSequenceAnnotationCount()
205     {
206         return _alignmentSequenceAnnotationList.size();
207     } //-- int getAlignmentSequenceAnnotationCount() 
208
209     /**
210      * Returns the value of field 'id'. The field 'id' has the
211      * following description: Primary Key for
212      *  vamsas object
213      *  referencing
214      *  
215      * 
216      * @return String
217      * @return the value of field 'id'.
218      */
219     public java.lang.String getId()
220     {
221         return this._id;
222     } //-- java.lang.String getId() 
223
224     /**
225      * Returns the value of field 'refid'. The field 'refid' has
226      * the following description: Dataset Sequence
227      *  from which this
228      *  alignment
229      *  sequence is
230      *  taken from
231      *  
232      * 
233      * @return Object
234      * @return the value of field 'refid'.
235      */
236     public java.lang.Object getRefid()
237     {
238         return this._refid;
239     } //-- java.lang.Object getRefid() 
240
241     /**
242      * Method isValid
243      * 
244      * 
245      * 
246      * @return boolean
247      */
248     public boolean isValid()
249     {
250         try {
251             validate();
252         }
253         catch (org.exolab.castor.xml.ValidationException vex) {
254             return false;
255         }
256         return true;
257     } //-- boolean isValid() 
258
259     /**
260      * Method marshal
261      * 
262      * 
263      * 
264      * @param out
265      */
266     public void marshal(java.io.Writer out)
267         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
268     {
269         
270         Marshaller.marshal(this, out);
271     } //-- void marshal(java.io.Writer) 
272
273     /**
274      * Method marshal
275      * 
276      * 
277      * 
278      * @param handler
279      */
280     public void marshal(org.xml.sax.ContentHandler handler)
281         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
282     {
283         
284         Marshaller.marshal(this, handler);
285     } //-- void marshal(org.xml.sax.ContentHandler) 
286
287     /**
288      * Method removeAlignmentSequenceAnnotation
289      * 
290      * 
291      * 
292      * @param index
293      * @return AlignmentSequenceAnnotation
294      */
295     public org.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int index)
296     {
297         java.lang.Object obj = _alignmentSequenceAnnotationList.elementAt(index);
298         _alignmentSequenceAnnotationList.removeElementAt(index);
299         return (org.vamsas.objects.core.AlignmentSequenceAnnotation) obj;
300     } //-- org.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int) 
301
302     /**
303      * Method removeAllAlignmentSequenceAnnotation
304      * 
305      */
306     public void removeAllAlignmentSequenceAnnotation()
307     {
308         _alignmentSequenceAnnotationList.removeAllElements();
309     } //-- void removeAllAlignmentSequenceAnnotation() 
310
311     /**
312      * Method setAlignmentSequenceAnnotation
313      * 
314      * 
315      * 
316      * @param index
317      * @param vAlignmentSequenceAnnotation
318      */
319     public void setAlignmentSequenceAnnotation(int index, org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
320         throws java.lang.IndexOutOfBoundsException
321     {
322         //-- check bounds for index
323         if ((index < 0) || (index > _alignmentSequenceAnnotationList.size())) {
324             throw new IndexOutOfBoundsException("setAlignmentSequenceAnnotation: Index value '"+index+"' not in range [0.."+_alignmentSequenceAnnotationList.size()+ "]");
325         }
326         _alignmentSequenceAnnotationList.setElementAt(vAlignmentSequenceAnnotation, index);
327     } //-- void setAlignmentSequenceAnnotation(int, org.vamsas.objects.core.AlignmentSequenceAnnotation) 
328
329     /**
330      * Method setAlignmentSequenceAnnotation
331      * 
332      * 
333      * 
334      * @param alignmentSequenceAnnotationArray
335      */
336     public void setAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation[] alignmentSequenceAnnotationArray)
337     {
338         //-- copy array
339         _alignmentSequenceAnnotationList.removeAllElements();
340         for (int i = 0; i < alignmentSequenceAnnotationArray.length; i++) {
341             _alignmentSequenceAnnotationList.addElement(alignmentSequenceAnnotationArray[i]);
342         }
343     } //-- void setAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation) 
344
345     /**
346      * Sets the value of field 'id'. The field 'id' has the
347      * following description: Primary Key for
348      *  vamsas object
349      *  referencing
350      *  
351      * 
352      * @param id the value of field 'id'.
353      */
354     public void setId(java.lang.String id)
355     {
356         this._id = id;
357     } //-- void setId(java.lang.String) 
358
359     /**
360      * Sets the value of field 'refid'. The field 'refid' has the
361      * following description: Dataset Sequence
362      *  from which this
363      *  alignment
364      *  sequence is
365      *  taken from
366      *  
367      * 
368      * @param refid the value of field 'refid'.
369      */
370     public void setRefid(java.lang.Object refid)
371     {
372         this._refid = refid;
373     } //-- void setRefid(java.lang.Object) 
374
375     /**
376      * Method unmarshal
377      * 
378      * 
379      * 
380      * @param reader
381      * @return SequenceType
382      */
383     public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
384         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
385     {
386         return (org.vamsas.objects.core.AlignmentSequence) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentSequence.class, reader);
387     } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader) 
388
389     /**
390      * Method validate
391      * 
392      */
393     public void validate()
394         throws org.exolab.castor.xml.ValidationException
395     {
396         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
397         validator.validate(this);
398     } //-- void validate() 
399
400 }