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
78 private java.util.Vector _propertyList;
83 private java.util.Vector _mappingList;
93 _propertyList = new Vector();
94 _mappingList = new Vector();
95 } //-- org.vamsas.objects.core.SequenceType()
109 public void addMapping(org.vamsas.objects.core.Mapping vMapping)
110 throws java.lang.IndexOutOfBoundsException
112 _mappingList.addElement(vMapping);
113 } //-- void addMapping(org.vamsas.objects.core.Mapping)
123 public void addMapping(int index, org.vamsas.objects.core.Mapping vMapping)
124 throws java.lang.IndexOutOfBoundsException
126 _mappingList.insertElementAt(vMapping, index);
127 } //-- void addMapping(int, org.vamsas.objects.core.Mapping)
136 public void addProperty(org.vamsas.objects.core.Property vProperty)
137 throws java.lang.IndexOutOfBoundsException
139 _propertyList.addElement(vProperty);
140 } //-- void addProperty(org.vamsas.objects.core.Property)
150 public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
151 throws java.lang.IndexOutOfBoundsException
153 _propertyList.insertElementAt(vProperty, index);
154 } //-- void addProperty(int, org.vamsas.objects.core.Property)
160 public void deleteEnd()
162 this._has_end= false;
163 } //-- void deleteEnd()
169 public void deleteStart()
171 this._has_start= false;
172 } //-- void deleteStart()
175 * Method enumerateMapping
179 * @return Enumeration
181 public java.util.Enumeration enumerateMapping()
183 return _mappingList.elements();
184 } //-- java.util.Enumeration enumerateMapping()
187 * Method enumerateProperty
191 * @return Enumeration
193 public java.util.Enumeration enumerateProperty()
195 return _propertyList.elements();
196 } //-- java.util.Enumeration enumerateProperty()
199 * Note: hashCode() has not been overriden
204 public boolean equals(java.lang.Object obj)
209 if (super.equals(obj)==false)
212 if (obj instanceof SequenceType) {
214 SequenceType temp = (SequenceType)obj;
215 if (this._start != temp._start)
217 if (this._has_start != temp._has_start)
219 if (this._end != temp._end)
221 if (this._has_end != temp._has_end)
223 if (this._sequence != null) {
224 if (temp._sequence == null) return false;
225 else if (!(this._sequence.equals(temp._sequence)))
228 else if (temp._sequence != null)
230 if (this._name != null) {
231 if (temp._name == null) return false;
232 else if (!(this._name.equals(temp._name)))
235 else if (temp._name != null)
237 if (this._description != null) {
238 if (temp._description == null) return false;
239 else if (!(this._description.equals(temp._description)))
242 else if (temp._description != null)
244 if (this._propertyList != null) {
245 if (temp._propertyList == null) return false;
246 else if (!(this._propertyList.equals(temp._propertyList)))
249 else if (temp._propertyList != null)
251 if (this._mappingList != null) {
252 if (temp._mappingList == null) return false;
253 else if (!(this._mappingList.equals(temp._mappingList)))
256 else if (temp._mappingList != null)
261 } //-- boolean equals(java.lang.Object)
264 * Returns the value of field 'description'.
267 * @return the value of field 'description'.
269 public java.lang.String getDescription()
271 return this._description;
272 } //-- java.lang.String getDescription()
275 * Returns the value of field 'end'.
278 * @return the value of field 'end'.
293 public org.vamsas.objects.core.Mapping getMapping(int index)
294 throws java.lang.IndexOutOfBoundsException
296 //-- check bounds for index
297 if ((index < 0) || (index > _mappingList.size())) {
298 throw new IndexOutOfBoundsException("getMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]");
301 return (org.vamsas.objects.core.Mapping) _mappingList.elementAt(index);
302 } //-- org.vamsas.objects.core.Mapping getMapping(int)
311 public org.vamsas.objects.core.Mapping[] getMapping()
313 int size = _mappingList.size();
314 org.vamsas.objects.core.Mapping[] mArray = new org.vamsas.objects.core.Mapping[size];
315 for (int index = 0; index < size; index++) {
316 mArray[index] = (org.vamsas.objects.core.Mapping) _mappingList.elementAt(index);
319 } //-- org.vamsas.objects.core.Mapping[] getMapping()
322 * Method getMappingCount
328 public int getMappingCount()
330 return _mappingList.size();
331 } //-- int getMappingCount()
334 * Returns the value of field 'name'.
337 * @return the value of field 'name'.
339 public java.lang.String getName()
342 } //-- java.lang.String getName()
352 public org.vamsas.objects.core.Property getProperty(int index)
353 throws java.lang.IndexOutOfBoundsException
355 //-- check bounds for index
356 if ((index < 0) || (index > _propertyList.size())) {
357 throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
360 return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
361 } //-- org.vamsas.objects.core.Property getProperty(int)
370 public org.vamsas.objects.core.Property[] getProperty()
372 int size = _propertyList.size();
373 org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
374 for (int index = 0; index < size; index++) {
375 mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
378 } //-- org.vamsas.objects.core.Property[] getProperty()
381 * Method getPropertyCount
387 public int getPropertyCount()
389 return _propertyList.size();
390 } //-- int getPropertyCount()
393 * Returns the value of field 'sequence'.
396 * @return the value of field 'sequence'.
398 public java.lang.String getSequence()
400 return this._sequence;
401 } //-- java.lang.String getSequence()
404 * Returns the value of field 'start'.
407 * @return the value of field 'start'.
409 public int getStart()
412 } //-- int getStart()
421 public boolean hasEnd()
423 return this._has_end;
424 } //-- boolean hasEnd()
433 public boolean hasStart()
435 return this._has_start;
436 } //-- boolean hasStart()
445 public boolean isValid()
450 catch (org.exolab.castor.xml.ValidationException vex) {
454 } //-- boolean isValid()
463 public void marshal(java.io.Writer out)
464 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
467 Marshaller.marshal(this, out);
468 } //-- void marshal(java.io.Writer)
477 public void marshal(org.xml.sax.ContentHandler handler)
478 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
481 Marshaller.marshal(this, handler);
482 } //-- void marshal(org.xml.sax.ContentHandler)
485 * Method removeAllMapping
488 public void removeAllMapping()
490 _mappingList.removeAllElements();
491 } //-- void removeAllMapping()
494 * Method removeAllProperty
497 public void removeAllProperty()
499 _propertyList.removeAllElements();
500 } //-- void removeAllProperty()
503 * Method removeMapping
510 public org.vamsas.objects.core.Mapping removeMapping(int index)
512 java.lang.Object obj = _mappingList.elementAt(index);
513 _mappingList.removeElementAt(index);
514 return (org.vamsas.objects.core.Mapping) obj;
515 } //-- org.vamsas.objects.core.Mapping removeMapping(int)
518 * Method removeProperty
525 public org.vamsas.objects.core.Property removeProperty(int index)
527 java.lang.Object obj = _propertyList.elementAt(index);
528 _propertyList.removeElementAt(index);
529 return (org.vamsas.objects.core.Property) obj;
530 } //-- org.vamsas.objects.core.Property removeProperty(int)
533 * Sets the value of field 'description'.
535 * @param description the value of field 'description'.
537 public void setDescription(java.lang.String description)
539 this._description = description;
540 } //-- void setDescription(java.lang.String)
543 * Sets the value of field 'end'.
545 * @param end the value of field 'end'.
547 public void setEnd(int end)
550 this._has_end = true;
551 } //-- void setEnd(int)
561 public void setMapping(int index, org.vamsas.objects.core.Mapping vMapping)
562 throws java.lang.IndexOutOfBoundsException
564 //-- check bounds for index
565 if ((index < 0) || (index > _mappingList.size())) {
566 throw new IndexOutOfBoundsException("setMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]");
568 _mappingList.setElementAt(vMapping, index);
569 } //-- void setMapping(int, org.vamsas.objects.core.Mapping)
576 * @param mappingArray
578 public void setMapping(org.vamsas.objects.core.Mapping[] mappingArray)
581 _mappingList.removeAllElements();
582 for (int i = 0; i < mappingArray.length; i++) {
583 _mappingList.addElement(mappingArray[i]);
585 } //-- void setMapping(org.vamsas.objects.core.Mapping)
588 * Sets the value of field 'name'.
590 * @param name the value of field 'name'.
592 public void setName(java.lang.String name)
595 } //-- void setName(java.lang.String)
605 public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
606 throws java.lang.IndexOutOfBoundsException
608 //-- check bounds for index
609 if ((index < 0) || (index > _propertyList.size())) {
610 throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
612 _propertyList.setElementAt(vProperty, index);
613 } //-- void setProperty(int, org.vamsas.objects.core.Property)
620 * @param propertyArray
622 public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
625 _propertyList.removeAllElements();
626 for (int i = 0; i < propertyArray.length; i++) {
627 _propertyList.addElement(propertyArray[i]);
629 } //-- void setProperty(org.vamsas.objects.core.Property)
632 * Sets the value of field 'sequence'.
634 * @param sequence the value of field 'sequence'.
636 public void setSequence(java.lang.String sequence)
638 this._sequence = sequence;
639 } //-- void setSequence(java.lang.String)
642 * Sets the value of field 'start'.
644 * @param start the value of field 'start'.
646 public void setStart(int start)
649 this._has_start = true;
650 } //-- void setStart(int)
658 * @return SequenceType
660 public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
661 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
663 return (org.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceType.class, reader);
664 } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader)
670 public void validate()
671 throws org.exolab.castor.xml.ValidationException
673 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
674 validator.validate(this);
675 } //-- void validate()