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.Vobject
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.lang.String _description;
76 * additional typed properties
79 private java.util.Vector _propertyList;
89 _propertyList = new Vector();
90 } //-- org.vamsas.objects.core.SequenceType()
104 public void addProperty(org.vamsas.objects.core.Property vProperty)
105 throws java.lang.IndexOutOfBoundsException
107 _propertyList.addElement(vProperty);
108 } //-- void addProperty(org.vamsas.objects.core.Property)
118 public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
119 throws java.lang.IndexOutOfBoundsException
121 _propertyList.insertElementAt(vProperty, index);
122 } //-- void addProperty(int, org.vamsas.objects.core.Property)
128 public void deleteEnd()
130 this._has_end= false;
131 } //-- void deleteEnd()
137 public void deleteStart()
139 this._has_start= false;
140 } //-- void deleteStart()
143 * Method enumerateProperty
147 * @return Enumeration
149 public java.util.Enumeration enumerateProperty()
151 return _propertyList.elements();
152 } //-- java.util.Enumeration enumerateProperty()
155 * Note: hashCode() has not been overriden
160 public boolean equals(java.lang.Object obj)
165 if (super.equals(obj)==false)
168 if (obj instanceof SequenceType) {
170 SequenceType temp = (SequenceType)obj;
171 if (this._start != temp._start)
173 if (this._has_start != temp._has_start)
175 if (this._end != temp._end)
177 if (this._has_end != temp._has_end)
179 if (this._sequence != null) {
180 if (temp._sequence == null) return false;
181 else if (!(this._sequence.equals(temp._sequence)))
184 else if (temp._sequence != null)
186 if (this._name != null) {
187 if (temp._name == null) return false;
188 else if (!(this._name.equals(temp._name)))
191 else if (temp._name != null)
193 if (this._description != null) {
194 if (temp._description == null) return false;
195 else if (!(this._description.equals(temp._description)))
198 else if (temp._description != null)
200 if (this._propertyList != null) {
201 if (temp._propertyList == null) return false;
202 else if (!(this._propertyList.equals(temp._propertyList)))
205 else if (temp._propertyList != null)
210 } //-- boolean equals(java.lang.Object)
213 * Returns the value of field 'description'.
216 * @return the value of field 'description'.
218 public java.lang.String getDescription()
220 return this._description;
221 } //-- java.lang.String getDescription()
224 * Returns the value of field 'end'.
227 * @return the value of field 'end'.
235 * Returns the value of field 'name'.
238 * @return the value of field 'name'.
240 public java.lang.String getName()
243 } //-- java.lang.String getName()
253 public org.vamsas.objects.core.Property getProperty(int index)
254 throws java.lang.IndexOutOfBoundsException
256 //-- check bounds for index
257 if ((index < 0) || (index > _propertyList.size())) {
258 throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
261 return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
262 } //-- org.vamsas.objects.core.Property getProperty(int)
271 public org.vamsas.objects.core.Property[] getProperty()
273 int size = _propertyList.size();
274 org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
275 for (int index = 0; index < size; index++) {
276 mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
279 } //-- org.vamsas.objects.core.Property[] getProperty()
282 * Method getPropertyCount
288 public int getPropertyCount()
290 return _propertyList.size();
291 } //-- int getPropertyCount()
294 * Returns the value of field 'sequence'.
297 * @return the value of field 'sequence'.
299 public java.lang.String getSequence()
301 return this._sequence;
302 } //-- java.lang.String getSequence()
305 * Returns the value of field 'start'.
308 * @return the value of field 'start'.
310 public int getStart()
313 } //-- int getStart()
322 public boolean hasEnd()
324 return this._has_end;
325 } //-- boolean hasEnd()
334 public boolean hasStart()
336 return this._has_start;
337 } //-- boolean hasStart()
346 public boolean isValid()
351 catch (org.exolab.castor.xml.ValidationException vex) {
355 } //-- boolean isValid()
364 public void marshal(java.io.Writer out)
365 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
368 Marshaller.marshal(this, out);
369 } //-- void marshal(java.io.Writer)
378 public void marshal(org.xml.sax.ContentHandler handler)
379 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
382 Marshaller.marshal(this, handler);
383 } //-- void marshal(org.xml.sax.ContentHandler)
386 * Method removeAllProperty
389 public void removeAllProperty()
391 _propertyList.removeAllElements();
392 } //-- void removeAllProperty()
395 * Method removeProperty
402 public org.vamsas.objects.core.Property removeProperty(int index)
404 java.lang.Object obj = _propertyList.elementAt(index);
405 _propertyList.removeElementAt(index);
406 return (org.vamsas.objects.core.Property) obj;
407 } //-- org.vamsas.objects.core.Property removeProperty(int)
410 * Sets the value of field 'description'.
412 * @param description the value of field 'description'.
414 public void setDescription(java.lang.String description)
416 this._description = description;
417 } //-- void setDescription(java.lang.String)
420 * Sets the value of field 'end'.
422 * @param end the value of field 'end'.
424 public void setEnd(int end)
427 this._has_end = true;
428 } //-- void setEnd(int)
431 * Sets the value of field 'name'.
433 * @param name the value of field 'name'.
435 public void setName(java.lang.String name)
438 } //-- void setName(java.lang.String)
448 public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
449 throws java.lang.IndexOutOfBoundsException
451 //-- check bounds for index
452 if ((index < 0) || (index > _propertyList.size())) {
453 throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
455 _propertyList.setElementAt(vProperty, index);
456 } //-- void setProperty(int, org.vamsas.objects.core.Property)
463 * @param propertyArray
465 public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
468 _propertyList.removeAllElements();
469 for (int i = 0; i < propertyArray.length; i++) {
470 _propertyList.addElement(propertyArray[i]);
472 } //-- void setProperty(org.vamsas.objects.core.Property)
475 * Sets the value of field 'sequence'.
477 * @param sequence the value of field 'sequence'.
479 public void setSequence(java.lang.String sequence)
481 this._sequence = sequence;
482 } //-- void setSequence(java.lang.String)
485 * Sets the value of field 'start'.
487 * @param start the value of field 'start'.
489 public void setStart(int start)
492 this._has_start = true;
493 } //-- void setStart(int)
501 * @return SequenceType
503 public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
504 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
506 return (org.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceType.class, reader);
507 } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader)
513 public void validate()
514 throws org.exolab.castor.xml.ValidationException
516 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
517 validator.validate(this);
518 } //-- void validate()