2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M1</a>, using an XML
8 package org.vamsas.client.objects;
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 _sequence;
68 private java.lang.String _name;
73 private java.util.Vector _dbRefList;
83 _dbRefList = new Vector();
84 } //-- org.vamsas.client.objects.SequenceType()
98 public void addDbRef(org.vamsas.client.objects.DbRef vDbRef)
99 throws java.lang.IndexOutOfBoundsException
101 _dbRefList.addElement(vDbRef);
102 } //-- void addDbRef(org.vamsas.client.objects.DbRef)
112 public void addDbRef(int index, org.vamsas.client.objects.DbRef vDbRef)
113 throws java.lang.IndexOutOfBoundsException
115 _dbRefList.insertElementAt(vDbRef, index);
116 } //-- void addDbRef(int, org.vamsas.client.objects.DbRef)
122 public void deleteEnd()
124 this._has_end= false;
125 } //-- void deleteEnd()
131 public void deleteStart()
133 this._has_start= false;
134 } //-- void deleteStart()
137 * Method enumerateDbRef
141 * @return Enumeration
143 public java.util.Enumeration enumerateDbRef()
145 return _dbRefList.elements();
146 } //-- java.util.Enumeration enumerateDbRef()
149 * Note: hashCode() has not been overriden
154 public boolean equals(java.lang.Object obj)
159 if (super.equals(obj)==false)
162 if (obj instanceof SequenceType) {
164 SequenceType temp = (SequenceType)obj;
165 if (this._start != temp._start)
167 if (this._has_start != temp._has_start)
169 if (this._end != temp._end)
171 if (this._has_end != temp._has_end)
173 if (this._sequence != null) {
174 if (temp._sequence == null) return false;
175 else if (!(this._sequence.equals(temp._sequence)))
178 else if (temp._sequence != null)
180 if (this._name != null) {
181 if (temp._name == null) return false;
182 else if (!(this._name.equals(temp._name)))
185 else if (temp._name != null)
187 if (this._dbRefList != null) {
188 if (temp._dbRefList == null) return false;
189 else if (!(this._dbRefList.equals(temp._dbRefList)))
192 else if (temp._dbRefList != null)
197 } //-- boolean equals(java.lang.Object)
207 public org.vamsas.client.objects.DbRef getDbRef(int index)
208 throws java.lang.IndexOutOfBoundsException
210 //-- check bounds for index
211 if ((index < 0) || (index > _dbRefList.size())) {
212 throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
215 return (org.vamsas.client.objects.DbRef) _dbRefList.elementAt(index);
216 } //-- org.vamsas.client.objects.DbRef getDbRef(int)
225 public org.vamsas.client.objects.DbRef[] getDbRef()
227 int size = _dbRefList.size();
228 org.vamsas.client.objects.DbRef[] mArray = new org.vamsas.client.objects.DbRef[size];
229 for (int index = 0; index < size; index++) {
230 mArray[index] = (org.vamsas.client.objects.DbRef) _dbRefList.elementAt(index);
233 } //-- org.vamsas.client.objects.DbRef[] getDbRef()
236 * Method getDbRefAsReference
238 * Returns a reference to 'dbRef'. No type checking is
239 * performed on any modications to the Vector.
242 * @return returns a reference to the Vector.
244 public java.util.Vector getDbRefAsReference()
247 } //-- java.util.Vector getDbRefAsReference()
250 * Method getDbRefCount
256 public int getDbRefCount()
258 return _dbRefList.size();
259 } //-- int getDbRefCount()
262 * Returns the value of field 'end'.
265 * @return the value of field 'end'.
273 * Returns the value of field 'name'.
276 * @return the value of field 'name'.
278 public java.lang.String getName()
281 } //-- java.lang.String getName()
284 * Returns the value of field 'sequence'.
287 * @return the value of field 'sequence'.
289 public java.lang.String getSequence()
291 return this._sequence;
292 } //-- java.lang.String getSequence()
295 * Returns the value of field 'start'.
298 * @return the value of field 'start'.
300 public int getStart()
303 } //-- int getStart()
312 public boolean hasEnd()
314 return this._has_end;
315 } //-- boolean hasEnd()
324 public boolean hasStart()
326 return this._has_start;
327 } //-- boolean hasStart()
336 public boolean isValid()
341 catch (org.exolab.castor.xml.ValidationException vex) {
345 } //-- boolean isValid()
354 public void marshal(java.io.Writer out)
355 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
358 Marshaller.marshal(this, out);
359 } //-- void marshal(java.io.Writer)
368 public void marshal(org.xml.sax.ContentHandler handler)
369 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
372 Marshaller.marshal(this, handler);
373 } //-- void marshal(org.xml.sax.ContentHandler)
376 * Method removeAllDbRef
379 public void removeAllDbRef()
381 _dbRefList.removeAllElements();
382 } //-- void removeAllDbRef()
392 public org.vamsas.client.objects.DbRef removeDbRef(int index)
394 java.lang.Object obj = _dbRefList.elementAt(index);
395 _dbRefList.removeElementAt(index);
396 return (org.vamsas.client.objects.DbRef) obj;
397 } //-- org.vamsas.client.objects.DbRef removeDbRef(int)
407 public void setDbRef(int index, org.vamsas.client.objects.DbRef vDbRef)
408 throws java.lang.IndexOutOfBoundsException
410 //-- check bounds for index
411 if ((index < 0) || (index > _dbRefList.size())) {
412 throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
414 _dbRefList.setElementAt(vDbRef, index);
415 } //-- void setDbRef(int, org.vamsas.client.objects.DbRef)
424 public void setDbRef(org.vamsas.client.objects.DbRef[] dbRefArray)
427 _dbRefList.removeAllElements();
428 for (int i = 0; i < dbRefArray.length; i++) {
429 _dbRefList.addElement(dbRefArray[i]);
431 } //-- void setDbRef(org.vamsas.client.objects.DbRef)
436 * Sets the value of 'dbRef' by copying the given Vector.
438 * @param dbRefVector the Vector to copy.
440 public void setDbRef(java.util.Vector dbRefVector)
443 _dbRefList.removeAllElements();
444 for (int i = 0; i < dbRefVector.size(); i++) {
445 _dbRefList.addElement((org.vamsas.client.objects.DbRef)dbRefVector.elementAt(i));
447 } //-- void setDbRef(java.util.Vector)
450 * Method setDbRefAsReference
452 * Sets the value of 'dbRef' by setting it to the given Vector.
453 * No type checking is performed.
455 * @param dbRefVector the Vector to copy.
457 public void setDbRefAsReference(java.util.Vector dbRefVector)
459 _dbRefList = dbRefVector;
460 } //-- void setDbRefAsReference(java.util.Vector)
463 * Sets the value of field 'end'.
465 * @param end the value of field 'end'.
467 public void setEnd(int end)
470 this._has_end = true;
471 } //-- void setEnd(int)
474 * Sets the value of field 'name'.
476 * @param name the value of field 'name'.
478 public void setName(java.lang.String name)
481 } //-- void setName(java.lang.String)
484 * Sets the value of field 'sequence'.
486 * @param sequence the value of field 'sequence'.
488 public void setSequence(java.lang.String sequence)
490 this._sequence = sequence;
491 } //-- void setSequence(java.lang.String)
494 * Sets the value of field 'start'.
496 * @param start the value of field 'start'.
498 public void setStart(int start)
501 this._has_start = true;
502 } //-- void setStart(int)
510 * @return SequenceType
512 public static org.vamsas.client.objects.SequenceType unmarshal(java.io.Reader reader)
513 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
515 return (org.vamsas.client.objects.SequenceType) Unmarshaller.unmarshal(org.vamsas.client.objects.SequenceType.class, reader);
516 } //-- org.vamsas.client.objects.SequenceType unmarshal(java.io.Reader)
522 public void validate()
523 throws org.exolab.castor.xml.ValidationException
525 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
526 validator.validate(this);
527 } //-- void validate()