/* * This class was automatically generated with * Castor 0.9.9M1, using an XML * Schema. * $Id$ */ package org.vamsas.client.objects; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import java.io.IOException; import java.io.Reader; import java.io.Serializable; import java.io.Writer; import java.util.Enumeration; import java.util.Vector; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** * Class SequenceType. * * @version $Revision$ $Date$ */ public class SequenceType extends org.vamsas.client.object implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _start */ private int _start; /** * keeps track of state for field: _start */ private boolean _has_start; /** * Field _end */ private int _end; /** * keeps track of state for field: _end */ private boolean _has_end; /** * Field _sequence */ private java.lang.String _sequence; /** * Field _name */ private java.lang.String _name; /** * Field _dbRefList */ private java.util.Vector _dbRefList; //----------------/ //- Constructors -/ //----------------/ public SequenceType() { super(); _dbRefList = new Vector(); } //-- org.vamsas.client.objects.SequenceType() //-----------/ //- Methods -/ //-----------/ /** * Method addDbRef * * * * @param vDbRef */ public void addDbRef(org.vamsas.client.objects.DbRef vDbRef) throws java.lang.IndexOutOfBoundsException { _dbRefList.addElement(vDbRef); } //-- void addDbRef(org.vamsas.client.objects.DbRef) /** * Method addDbRef * * * * @param index * @param vDbRef */ public void addDbRef(int index, org.vamsas.client.objects.DbRef vDbRef) throws java.lang.IndexOutOfBoundsException { _dbRefList.insertElementAt(vDbRef, index); } //-- void addDbRef(int, org.vamsas.client.objects.DbRef) /** * Method deleteEnd * */ public void deleteEnd() { this._has_end= false; } //-- void deleteEnd() /** * Method deleteStart * */ public void deleteStart() { this._has_start= false; } //-- void deleteStart() /** * Method enumerateDbRef * * * * @return Enumeration */ public java.util.Enumeration enumerateDbRef() { return _dbRefList.elements(); } //-- java.util.Enumeration enumerateDbRef() /** * Note: hashCode() has not been overriden * * @param obj * @return boolean */ public boolean equals(java.lang.Object obj) { if ( this == obj ) return true; if (super.equals(obj)==false) return false; if (obj instanceof SequenceType) { SequenceType temp = (SequenceType)obj; if (this._start != temp._start) return false; if (this._has_start != temp._has_start) return false; if (this._end != temp._end) return false; if (this._has_end != temp._has_end) return false; if (this._sequence != null) { if (temp._sequence == null) return false; else if (!(this._sequence.equals(temp._sequence))) return false; } else if (temp._sequence != null) return false; if (this._name != null) { if (temp._name == null) return false; else if (!(this._name.equals(temp._name))) return false; } else if (temp._name != null) return false; if (this._dbRefList != null) { if (temp._dbRefList == null) return false; else if (!(this._dbRefList.equals(temp._dbRefList))) return false; } else if (temp._dbRefList != null) return false; return true; } return false; } //-- boolean equals(java.lang.Object) /** * Method getDbRef * * * * @param index * @return DbRef */ public org.vamsas.client.objects.DbRef getDbRef(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _dbRefList.size())) { throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]"); } return (org.vamsas.client.objects.DbRef) _dbRefList.elementAt(index); } //-- org.vamsas.client.objects.DbRef getDbRef(int) /** * Method getDbRef * * * * @return DbRef */ public org.vamsas.client.objects.DbRef[] getDbRef() { int size = _dbRefList.size(); org.vamsas.client.objects.DbRef[] mArray = new org.vamsas.client.objects.DbRef[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.client.objects.DbRef) _dbRefList.elementAt(index); } return mArray; } //-- org.vamsas.client.objects.DbRef[] getDbRef() /** * Method getDbRefAsReference * * Returns a reference to 'dbRef'. No type checking is * performed on any modications to the Vector. * * @return Vector * @return returns a reference to the Vector. */ public java.util.Vector getDbRefAsReference() { return _dbRefList; } //-- java.util.Vector getDbRefAsReference() /** * Method getDbRefCount * * * * @return int */ public int getDbRefCount() { return _dbRefList.size(); } //-- int getDbRefCount() /** * Returns the value of field 'end'. * * @return int * @return the value of field 'end'. */ public int getEnd() { return this._end; } //-- int getEnd() /** * Returns the value of field 'name'. * * @return String * @return the value of field 'name'. */ public java.lang.String getName() { return this._name; } //-- java.lang.String getName() /** * Returns the value of field 'sequence'. * * @return String * @return the value of field 'sequence'. */ public java.lang.String getSequence() { return this._sequence; } //-- java.lang.String getSequence() /** * Returns the value of field 'start'. * * @return int * @return the value of field 'start'. */ public int getStart() { return this._start; } //-- int getStart() /** * Method hasEnd * * * * @return boolean */ public boolean hasEnd() { return this._has_end; } //-- boolean hasEnd() /** * Method hasStart * * * * @return boolean */ public boolean hasStart() { return this._has_start; } //-- boolean hasStart() /** * Method isValid * * * * @return boolean */ public boolean isValid() { try { validate(); } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; } //-- boolean isValid() /** * Method marshal * * * * @param out */ public void marshal(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } //-- void marshal(java.io.Writer) /** * Method marshal * * * * @param handler */ public void marshal(org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); } //-- void marshal(org.xml.sax.ContentHandler) /** * Method removeAllDbRef * */ public void removeAllDbRef() { _dbRefList.removeAllElements(); } //-- void removeAllDbRef() /** * Method removeDbRef * * * * @param index * @return DbRef */ public org.vamsas.client.objects.DbRef removeDbRef(int index) { java.lang.Object obj = _dbRefList.elementAt(index); _dbRefList.removeElementAt(index); return (org.vamsas.client.objects.DbRef) obj; } //-- org.vamsas.client.objects.DbRef removeDbRef(int) /** * Method setDbRef * * * * @param index * @param vDbRef */ public void setDbRef(int index, org.vamsas.client.objects.DbRef vDbRef) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _dbRefList.size())) { throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]"); } _dbRefList.setElementAt(vDbRef, index); } //-- void setDbRef(int, org.vamsas.client.objects.DbRef) /** * Method setDbRef * * * * @param dbRefArray */ public void setDbRef(org.vamsas.client.objects.DbRef[] dbRefArray) { //-- copy array _dbRefList.removeAllElements(); for (int i = 0; i < dbRefArray.length; i++) { _dbRefList.addElement(dbRefArray[i]); } } //-- void setDbRef(org.vamsas.client.objects.DbRef) /** * Method setDbRef * * Sets the value of 'dbRef' by copying the given Vector. * * @param dbRefVector the Vector to copy. */ public void setDbRef(java.util.Vector dbRefVector) { //-- copy vector _dbRefList.removeAllElements(); for (int i = 0; i < dbRefVector.size(); i++) { _dbRefList.addElement((org.vamsas.client.objects.DbRef)dbRefVector.elementAt(i)); } } //-- void setDbRef(java.util.Vector) /** * Method setDbRefAsReference * * Sets the value of 'dbRef' by setting it to the given Vector. * No type checking is performed. * * @param dbRefVector the Vector to copy. */ public void setDbRefAsReference(java.util.Vector dbRefVector) { _dbRefList = dbRefVector; } //-- void setDbRefAsReference(java.util.Vector) /** * Sets the value of field 'end'. * * @param end the value of field 'end'. */ public void setEnd(int end) { this._end = end; this._has_end = true; } //-- void setEnd(int) /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ public void setName(java.lang.String name) { this._name = name; } //-- void setName(java.lang.String) /** * Sets the value of field 'sequence'. * * @param sequence the value of field 'sequence'. */ public void setSequence(java.lang.String sequence) { this._sequence = sequence; } //-- void setSequence(java.lang.String) /** * Sets the value of field 'start'. * * @param start the value of field 'start'. */ public void setStart(int start) { this._start = start; this._has_start = true; } //-- void setStart(int) /** * Method unmarshal * * * * @param reader * @return SequenceType */ public static org.vamsas.client.objects.SequenceType unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.vamsas.client.objects.SequenceType) Unmarshaller.unmarshal(org.vamsas.client.objects.SequenceType.class, reader); } //-- org.vamsas.client.objects.SequenceType unmarshal(java.io.Reader) /** * Method validate * */ public void validate() throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); } //-- void validate() }