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;
29 * @version $Revision$ $Date$
31 public class SequenceType extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
46 * keeps track of state for field: _start
48 private boolean _has_start;
56 * keeps track of state for field: _end
58 private boolean _has_end;
63 private java.lang.String _id;
68 private java.lang.String _sequence;
73 private java.lang.String _name;
78 private java.util.Vector _dbRefList;
88 _dbRefList = new Vector();
89 } //-- org.vamsas.objects.core.SequenceType()
103 public void addDbRef(org.vamsas.objects.core.DbRef vDbRef)
104 throws java.lang.IndexOutOfBoundsException
106 _dbRefList.addElement(vDbRef);
107 } //-- void addDbRef(org.vamsas.objects.core.DbRef)
117 public void addDbRef(int index, org.vamsas.objects.core.DbRef vDbRef)
118 throws java.lang.IndexOutOfBoundsException
120 _dbRefList.insertElementAt(vDbRef, index);
121 } //-- void addDbRef(int, org.vamsas.objects.core.DbRef)
127 public void deleteEnd()
129 this._has_end= false;
130 } //-- void deleteEnd()
136 public void deleteStart()
138 this._has_start= false;
139 } //-- void deleteStart()
142 * Method enumerateDbRef
146 * @return Enumeration
148 public java.util.Enumeration enumerateDbRef()
150 return _dbRefList.elements();
151 } //-- java.util.Enumeration enumerateDbRef()
154 * Note: hashCode() has not been overriden
159 public boolean equals(java.lang.Object obj)
164 if (super.equals(obj)==false)
167 if (obj instanceof SequenceType) {
169 SequenceType temp = (SequenceType)obj;
170 if (this._start != temp._start)
172 if (this._has_start != temp._has_start)
174 if (this._end != temp._end)
176 if (this._has_end != temp._has_end)
178 if (this._id != null) {
179 if (temp._id == null) return false;
180 else if (!(this._id.equals(temp._id)))
183 else if (temp._id != null)
185 if (this._sequence != null) {
186 if (temp._sequence == null) return false;
187 else if (!(this._sequence.equals(temp._sequence)))
190 else if (temp._sequence != null)
192 if (this._name != null) {
193 if (temp._name == null) return false;
194 else if (!(this._name.equals(temp._name)))
197 else if (temp._name != null)
199 if (this._dbRefList != null) {
200 if (temp._dbRefList == null) return false;
201 else if (!(this._dbRefList.equals(temp._dbRefList)))
204 else if (temp._dbRefList != null)
209 } //-- boolean equals(java.lang.Object)
219 public org.vamsas.objects.core.DbRef getDbRef(int index)
220 throws java.lang.IndexOutOfBoundsException
222 //-- check bounds for index
223 if ((index < 0) || (index > _dbRefList.size())) {
224 throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
227 return (org.vamsas.objects.core.DbRef) _dbRefList.elementAt(index);
228 } //-- org.vamsas.objects.core.DbRef getDbRef(int)
237 public org.vamsas.objects.core.DbRef[] getDbRef()
239 int size = _dbRefList.size();
240 org.vamsas.objects.core.DbRef[] mArray = new org.vamsas.objects.core.DbRef[size];
241 for (int index = 0; index < size; index++) {
242 mArray[index] = (org.vamsas.objects.core.DbRef) _dbRefList.elementAt(index);
245 } //-- org.vamsas.objects.core.DbRef[] getDbRef()
248 * Method getDbRefCount
254 public int getDbRefCount()
256 return _dbRefList.size();
257 } //-- int getDbRefCount()
260 * Returns the value of field 'end'.
263 * @return the value of field 'end'.
271 * Returns the value of field 'id'.
274 * @return the value of field 'id'.
276 public java.lang.String getId()
279 } //-- java.lang.String getId()
282 * Returns the value of field 'name'.
285 * @return the value of field 'name'.
287 public java.lang.String getName()
290 } //-- java.lang.String getName()
293 * Returns the value of field 'sequence'.
296 * @return the value of field 'sequence'.
298 public java.lang.String getSequence()
300 return this._sequence;
301 } //-- java.lang.String getSequence()
304 * Returns the value of field 'start'.
307 * @return the value of field 'start'.
309 public int getStart()
312 } //-- int getStart()
321 public boolean hasEnd()
323 return this._has_end;
324 } //-- boolean hasEnd()
333 public boolean hasStart()
335 return this._has_start;
336 } //-- boolean hasStart()
345 public boolean isValid()
350 catch (org.exolab.castor.xml.ValidationException vex) {
354 } //-- boolean isValid()
363 public void marshal(java.io.Writer out)
364 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
367 Marshaller.marshal(this, out);
368 } //-- void marshal(java.io.Writer)
377 public void marshal(org.xml.sax.ContentHandler handler)
378 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
381 Marshaller.marshal(this, handler);
382 } //-- void marshal(org.xml.sax.ContentHandler)
385 * Method removeAllDbRef
388 public void removeAllDbRef()
390 _dbRefList.removeAllElements();
391 } //-- void removeAllDbRef()
401 public org.vamsas.objects.core.DbRef removeDbRef(int index)
403 java.lang.Object obj = _dbRefList.elementAt(index);
404 _dbRefList.removeElementAt(index);
405 return (org.vamsas.objects.core.DbRef) obj;
406 } //-- org.vamsas.objects.core.DbRef removeDbRef(int)
416 public void setDbRef(int index, org.vamsas.objects.core.DbRef vDbRef)
417 throws java.lang.IndexOutOfBoundsException
419 //-- check bounds for index
420 if ((index < 0) || (index > _dbRefList.size())) {
421 throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
423 _dbRefList.setElementAt(vDbRef, index);
424 } //-- void setDbRef(int, org.vamsas.objects.core.DbRef)
433 public void setDbRef(org.vamsas.objects.core.DbRef[] dbRefArray)
436 _dbRefList.removeAllElements();
437 for (int i = 0; i < dbRefArray.length; i++) {
438 _dbRefList.addElement(dbRefArray[i]);
440 } //-- void setDbRef(org.vamsas.objects.core.DbRef)
443 * Sets the value of field 'end'.
445 * @param end the value of field 'end'.
447 public void setEnd(int end)
450 this._has_end = true;
451 } //-- void setEnd(int)
454 * Sets the value of field 'id'.
456 * @param id the value of field 'id'.
458 public void setId(java.lang.String id)
461 } //-- void setId(java.lang.String)
464 * Sets the value of field 'name'.
466 * @param name the value of field 'name'.
468 public void setName(java.lang.String name)
471 } //-- void setName(java.lang.String)
474 * Sets the value of field 'sequence'.
476 * @param sequence the value of field 'sequence'.
478 public void setSequence(java.lang.String sequence)
480 this._sequence = sequence;
481 } //-- void setSequence(java.lang.String)
484 * Sets the value of field 'start'.
486 * @param start the value of field 'start'.
488 public void setStart(int start)
491 this._has_start = true;
492 } //-- void setStart(int)
500 * @return SequenceType
502 public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
503 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
505 return (org.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceType.class, reader);
506 } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader)
512 public void validate()
513 throws org.exolab.castor.xml.ValidationException
515 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
516 validator.validate(this);
517 } //-- void validate()