/* * This class was automatically generated with * Castor 0.9.9M2, using an XML * Schema. * $Id$ */ package org.vamsas.objects.core; //---------------------------------/ //- 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 SequenceSetAnnotations. * * @version $Revision$ $Date$ */ public class SequenceSetAnnotations extends org.vamsas.client.object implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _type */ private java.lang.String _type; /** * Field _end */ private java.lang.String _end; /** * Field _begin */ private java.lang.String _begin; /** * Field _seqRef */ private java.lang.Object _seqRef; /** * Field _id */ private java.lang.String _id; /** * Field _description */ private java.lang.String _description; /** * Field _status */ private java.lang.String _status; /** * Field _annotationElementList */ private java.util.Vector _annotationElementList; /** * Field _provenanceList */ private java.util.Vector _provenanceList; //----------------/ //- Constructors -/ //----------------/ public SequenceSetAnnotations() { super(); _annotationElementList = new Vector(); _provenanceList = new Vector(); } //-- org.vamsas.objects.core.SequenceSetAnnotations() //-----------/ //- Methods -/ //-----------/ /** * Method addAnnotationElement * * * * @param vAnnotationElement */ public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement) throws java.lang.IndexOutOfBoundsException { _annotationElementList.addElement(vAnnotationElement); } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement) /** * Method addAnnotationElement * * * * @param index * @param vAnnotationElement */ public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement) throws java.lang.IndexOutOfBoundsException { _annotationElementList.insertElementAt(vAnnotationElement, index); } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) /** * Method addProvenance * * * * @param vProvenance */ public void addProvenance(org.vamsas.objects.core.Provenance vProvenance) throws java.lang.IndexOutOfBoundsException { _provenanceList.addElement(vProvenance); } //-- void addProvenance(org.vamsas.objects.core.Provenance) /** * Method addProvenance * * * * @param index * @param vProvenance */ public void addProvenance(int index, org.vamsas.objects.core.Provenance vProvenance) throws java.lang.IndexOutOfBoundsException { _provenanceList.insertElementAt(vProvenance, index); } //-- void addProvenance(int, org.vamsas.objects.core.Provenance) /** * Method enumerateAnnotationElement * * * * @return Enumeration */ public java.util.Enumeration enumerateAnnotationElement() { return _annotationElementList.elements(); } //-- java.util.Enumeration enumerateAnnotationElement() /** * Method enumerateProvenance * * * * @return Enumeration */ public java.util.Enumeration enumerateProvenance() { return _provenanceList.elements(); } //-- java.util.Enumeration enumerateProvenance() /** * 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 SequenceSetAnnotations) { SequenceSetAnnotations temp = (SequenceSetAnnotations)obj; if (this._type != null) { if (temp._type == null) return false; else if (!(this._type.equals(temp._type))) return false; } else if (temp._type != null) return false; if (this._end != null) { if (temp._end == null) return false; else if (!(this._end.equals(temp._end))) return false; } else if (temp._end != null) return false; if (this._begin != null) { if (temp._begin == null) return false; else if (!(this._begin.equals(temp._begin))) return false; } else if (temp._begin != null) return false; if (this._seqRef != null) { if (temp._seqRef == null) return false; else if (!(this._seqRef.equals(temp._seqRef))) return false; } else if (temp._seqRef != null) return false; if (this._id != null) { if (temp._id == null) return false; else if (!(this._id.equals(temp._id))) return false; } else if (temp._id != null) return false; if (this._description != null) { if (temp._description == null) return false; else if (!(this._description.equals(temp._description))) return false; } else if (temp._description != null) return false; if (this._status != null) { if (temp._status == null) return false; else if (!(this._status.equals(temp._status))) return false; } else if (temp._status != null) return false; if (this._annotationElementList != null) { if (temp._annotationElementList == null) return false; else if (!(this._annotationElementList.equals(temp._annotationElementList))) return false; } else if (temp._annotationElementList != null) return false; if (this._provenanceList != null) { if (temp._provenanceList == null) return false; else if (!(this._provenanceList.equals(temp._provenanceList))) return false; } else if (temp._provenanceList != null) return false; return true; } return false; } //-- boolean equals(java.lang.Object) /** * Method getAnnotationElement * * * * @param index * @return AnnotationElement */ public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _annotationElementList.size())) { throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]"); } return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int) /** * Method getAnnotationElement * * * * @return AnnotationElement */ public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() { int size = _annotationElementList.size(); org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); } return mArray; } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() /** * Method getAnnotationElementCount * * * * @return int */ public int getAnnotationElementCount() { return _annotationElementList.size(); } //-- int getAnnotationElementCount() /** * Returns the value of field 'begin'. * * @return String * @return the value of field 'begin'. */ public java.lang.String getBegin() { return this._begin; } //-- java.lang.String getBegin() /** * Returns the value of field 'description'. * * @return String * @return the value of field 'description'. */ public java.lang.String getDescription() { return this._description; } //-- java.lang.String getDescription() /** * Returns the value of field 'end'. * * @return String * @return the value of field 'end'. */ public java.lang.String getEnd() { return this._end; } //-- java.lang.String getEnd() /** * Returns the value of field 'id'. * * @return String * @return the value of field 'id'. */ public java.lang.String getId() { return this._id; } //-- java.lang.String getId() /** * Method getProvenance * * * * @param index * @return Provenance */ public org.vamsas.objects.core.Provenance getProvenance(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _provenanceList.size())) { throw new IndexOutOfBoundsException("getProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]"); } return (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index); } //-- org.vamsas.objects.core.Provenance getProvenance(int) /** * Method getProvenance * * * * @return Provenance */ public org.vamsas.objects.core.Provenance[] getProvenance() { int size = _provenanceList.size(); org.vamsas.objects.core.Provenance[] mArray = new org.vamsas.objects.core.Provenance[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index); } return mArray; } //-- org.vamsas.objects.core.Provenance[] getProvenance() /** * Method getProvenanceCount * * * * @return int */ public int getProvenanceCount() { return _provenanceList.size(); } //-- int getProvenanceCount() /** * Returns the value of field 'seqRef'. * * @return Object * @return the value of field 'seqRef'. */ public java.lang.Object getSeqRef() { return this._seqRef; } //-- java.lang.Object getSeqRef() /** * Returns the value of field 'status'. * * @return String * @return the value of field 'status'. */ public java.lang.String getStatus() { return this._status; } //-- java.lang.String getStatus() /** * Returns the value of field 'type'. * * @return String * @return the value of field 'type'. */ public java.lang.String getType() { return this._type; } //-- java.lang.String getType() /** * 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 removeAllAnnotationElement * */ public void removeAllAnnotationElement() { _annotationElementList.removeAllElements(); } //-- void removeAllAnnotationElement() /** * Method removeAllProvenance * */ public void removeAllProvenance() { _provenanceList.removeAllElements(); } //-- void removeAllProvenance() /** * Method removeAnnotationElement * * * * @param index * @return AnnotationElement */ public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index) { java.lang.Object obj = _annotationElementList.elementAt(index); _annotationElementList.removeElementAt(index); return (org.vamsas.objects.core.AnnotationElement) obj; } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int) /** * Method removeProvenance * * * * @param index * @return Provenance */ public org.vamsas.objects.core.Provenance removeProvenance(int index) { java.lang.Object obj = _provenanceList.elementAt(index); _provenanceList.removeElementAt(index); return (org.vamsas.objects.core.Provenance) obj; } //-- org.vamsas.objects.core.Provenance removeProvenance(int) /** * Method setAnnotationElement * * * * @param index * @param vAnnotationElement */ public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _annotationElementList.size())) { throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]"); } _annotationElementList.setElementAt(vAnnotationElement, index); } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) /** * Method setAnnotationElement * * * * @param annotationElementArray */ public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray) { //-- copy array _annotationElementList.removeAllElements(); for (int i = 0; i < annotationElementArray.length; i++) { _annotationElementList.addElement(annotationElementArray[i]); } } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement) /** * Sets the value of field 'begin'. * * @param begin the value of field 'begin'. */ public void setBegin(java.lang.String begin) { this._begin = begin; } //-- void setBegin(java.lang.String) /** * Sets the value of field 'description'. * * @param description the value of field 'description'. */ public void setDescription(java.lang.String description) { this._description = description; } //-- void setDescription(java.lang.String) /** * Sets the value of field 'end'. * * @param end the value of field 'end'. */ public void setEnd(java.lang.String end) { this._end = end; } //-- void setEnd(java.lang.String) /** * Sets the value of field 'id'. * * @param id the value of field 'id'. */ public void setId(java.lang.String id) { this._id = id; } //-- void setId(java.lang.String) /** * Method setProvenance * * * * @param index * @param vProvenance */ public void setProvenance(int index, org.vamsas.objects.core.Provenance vProvenance) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _provenanceList.size())) { throw new IndexOutOfBoundsException("setProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]"); } _provenanceList.setElementAt(vProvenance, index); } //-- void setProvenance(int, org.vamsas.objects.core.Provenance) /** * Method setProvenance * * * * @param provenanceArray */ public void setProvenance(org.vamsas.objects.core.Provenance[] provenanceArray) { //-- copy array _provenanceList.removeAllElements(); for (int i = 0; i < provenanceArray.length; i++) { _provenanceList.addElement(provenanceArray[i]); } } //-- void setProvenance(org.vamsas.objects.core.Provenance) /** * Sets the value of field 'seqRef'. * * @param seqRef the value of field 'seqRef'. */ public void setSeqRef(java.lang.Object seqRef) { this._seqRef = seqRef; } //-- void setSeqRef(java.lang.Object) /** * Sets the value of field 'status'. * * @param status the value of field 'status'. */ public void setStatus(java.lang.String status) { this._status = status; } //-- void setStatus(java.lang.String) /** * Sets the value of field 'type'. * * @param type the value of field 'type'. */ public void setType(java.lang.String type) { this._type = type; } //-- void setType(java.lang.String) /** * Method unmarshal * * * * @param reader * @return SequenceSetAnnotations */ public static org.vamsas.objects.core.SequenceSetAnnotations unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.vamsas.objects.core.SequenceSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSetAnnotations.class, reader); } //-- org.vamsas.objects.core.SequenceSetAnnotations 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() }