2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
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;
27 * Class AlignmentSequence.
29 * @version $Revision$ $Date$
31 public class AlignmentSequence extends org.vamsas.objects.core.SequenceType
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
46 private java.lang.String _id;
56 private java.lang.Object _refid;
59 * Field _alignmentSequenceAnnotationList
61 private java.util.Vector _alignmentSequenceAnnotationList;
68 public AlignmentSequence()
71 _alignmentSequenceAnnotationList = new Vector();
72 } //-- org.vamsas.objects.core.AlignmentSequence()
80 * Method addAlignmentSequenceAnnotation
84 * @param vAlignmentSequenceAnnotation
86 public void addAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
87 throws java.lang.IndexOutOfBoundsException
89 _alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation);
90 } //-- void addAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation)
93 * Method addAlignmentSequenceAnnotation
98 * @param vAlignmentSequenceAnnotation
100 public void addAlignmentSequenceAnnotation(int index, org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
101 throws java.lang.IndexOutOfBoundsException
103 _alignmentSequenceAnnotationList.insertElementAt(vAlignmentSequenceAnnotation, index);
104 } //-- void addAlignmentSequenceAnnotation(int, org.vamsas.objects.core.AlignmentSequenceAnnotation)
107 * Method enumerateAlignmentSequenceAnnotation
111 * @return Enumeration
113 public java.util.Enumeration enumerateAlignmentSequenceAnnotation()
115 return _alignmentSequenceAnnotationList.elements();
116 } //-- java.util.Enumeration enumerateAlignmentSequenceAnnotation()
119 * Note: hashCode() has not been overriden
124 public boolean equals(java.lang.Object obj)
129 if (super.equals(obj)==false)
132 if (obj instanceof AlignmentSequence) {
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)))
140 else if (temp._id != null)
142 if (this._refid != null) {
143 if (temp._refid == null) return false;
144 else if (!(this._refid.equals(temp._refid)))
147 else if (temp._refid != null)
149 if (this._alignmentSequenceAnnotationList != null) {
150 if (temp._alignmentSequenceAnnotationList == null) return false;
151 else if (!(this._alignmentSequenceAnnotationList.equals(temp._alignmentSequenceAnnotationList)))
154 else if (temp._alignmentSequenceAnnotationList != null)
159 } //-- boolean equals(java.lang.Object)
162 * Method getAlignmentSequenceAnnotation
167 * @return AlignmentSequenceAnnotation
169 public org.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int index)
170 throws java.lang.IndexOutOfBoundsException
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()+ "]");
177 return (org.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index);
178 } //-- org.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int)
181 * Method getAlignmentSequenceAnnotation
185 * @return AlignmentSequenceAnnotation
187 public org.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation()
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);
195 } //-- org.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation()
198 * Method getAlignmentSequenceAnnotationCount
204 public int getAlignmentSequenceAnnotationCount()
206 return _alignmentSequenceAnnotationList.size();
207 } //-- int getAlignmentSequenceAnnotationCount()
210 * Returns the value of field 'id'. The field 'id' has the
211 * following description: Primary Key for
217 * @return the value of field 'id'.
219 public java.lang.String getId()
222 } //-- java.lang.String getId()
225 * Returns the value of field 'refid'. The field 'refid' has
226 * the following description: Dataset Sequence
234 * @return the value of field 'refid'.
236 public java.lang.Object getRefid()
239 } //-- java.lang.Object getRefid()
248 public boolean isValid()
253 catch (org.exolab.castor.xml.ValidationException vex) {
257 } //-- boolean isValid()
266 public void marshal(java.io.Writer out)
267 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
270 Marshaller.marshal(this, out);
271 } //-- void marshal(java.io.Writer)
280 public void marshal(org.xml.sax.ContentHandler handler)
281 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
284 Marshaller.marshal(this, handler);
285 } //-- void marshal(org.xml.sax.ContentHandler)
288 * Method removeAlignmentSequenceAnnotation
293 * @return AlignmentSequenceAnnotation
295 public org.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int index)
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)
303 * Method removeAllAlignmentSequenceAnnotation
306 public void removeAllAlignmentSequenceAnnotation()
308 _alignmentSequenceAnnotationList.removeAllElements();
309 } //-- void removeAllAlignmentSequenceAnnotation()
312 * Method setAlignmentSequenceAnnotation
317 * @param vAlignmentSequenceAnnotation
319 public void setAlignmentSequenceAnnotation(int index, org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
320 throws java.lang.IndexOutOfBoundsException
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()+ "]");
326 _alignmentSequenceAnnotationList.setElementAt(vAlignmentSequenceAnnotation, index);
327 } //-- void setAlignmentSequenceAnnotation(int, org.vamsas.objects.core.AlignmentSequenceAnnotation)
330 * Method setAlignmentSequenceAnnotation
334 * @param alignmentSequenceAnnotationArray
336 public void setAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation[] alignmentSequenceAnnotationArray)
339 _alignmentSequenceAnnotationList.removeAllElements();
340 for (int i = 0; i < alignmentSequenceAnnotationArray.length; i++) {
341 _alignmentSequenceAnnotationList.addElement(alignmentSequenceAnnotationArray[i]);
343 } //-- void setAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation)
346 * Sets the value of field 'id'. The field 'id' has the
347 * following description: Primary Key for
352 * @param id the value of field 'id'.
354 public void setId(java.lang.String id)
357 } //-- void setId(java.lang.String)
360 * Sets the value of field 'refid'. The field 'refid' has the
361 * following description: Dataset Sequence
368 * @param refid the value of field 'refid'.
370 public void setRefid(java.lang.Object refid)
373 } //-- void setRefid(java.lang.Object)
381 * @return SequenceType
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
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)
393 public void validate()
394 throws org.exolab.castor.xml.ValidationException
396 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
397 validator.validate(this);
398 } //-- void validate()