X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fvamsas%2Fobjects%2Fcore%2FDataSetAnnotations.java;fp=src%2Forg%2Fvamsas%2Fobjects%2Fcore%2FDataSetAnnotations.java;h=abf6a8ff729a409395b621a4f98f209d3b266d57;hb=127eed38a79f4e1b56457a3cd5c5de12c9c7d4a2;hp=52c56e72a02cd311a700fa6a757d8be1e6a29a65;hpb=b0e8ba054e5c3d3cd256f78d3a7310e6e263630e;p=vamsas.git diff --git a/src/org/vamsas/objects/core/DataSetAnnotations.java b/src/org/vamsas/objects/core/DataSetAnnotations.java index 52c56e7..abf6a8f 100644 --- a/src/org/vamsas/objects/core/DataSetAnnotations.java +++ b/src/org/vamsas/objects/core/DataSetAnnotations.java @@ -15,8 +15,6 @@ 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; @@ -28,7 +26,7 @@ import org.xml.sax.ContentHandler; * * @version $Revision$ $Date$ */ -public class DataSetAnnotations extends org.vamsas.client.Vobject +public class DataSetAnnotations extends org.vamsas.objects.core.RangeAnnotation implements java.io.Serializable { @@ -38,56 +36,14 @@ implements java.io.Serializable //--------------------------/ /** - * Field _type - */ - private java.lang.String _type; - - /** - * Field _end - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _begin - */ - private int _begin; - - /** - * keeps track of state for field: _begin - */ - private boolean _has_begin; - - /** - * Field _seqRef + * annotation is associated + * with a particular dataset + * sequence + * */ 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 _provenance */ private org.vamsas.objects.core.Provenance _provenance; @@ -100,7 +56,6 @@ implements java.io.Serializable public DataSetAnnotations() { super(); - _annotationElementList = new Vector(); } //-- org.vamsas.objects.core.DataSetAnnotations() @@ -109,63 +64,6 @@ implements java.io.Serializable //-----------/ /** - * 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 deleteBegin - * - */ - public void deleteBegin() - { - this._has_begin= false; - } //-- void deleteBegin() - - /** - * Method deleteEnd - * - */ - public void deleteEnd() - { - this._has_end= false; - } //-- void deleteEnd() - - /** - * Method enumerateAnnotationElement - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateAnnotationElement() - { - return _annotationElementList.elements(); - } //-- java.util.Enumeration enumerateAnnotationElement() - - /** * Note: hashCode() has not been overriden * * @param obj @@ -182,21 +80,6 @@ implements java.io.Serializable if (obj instanceof DataSetAnnotations) { DataSetAnnotations temp = (DataSetAnnotations)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 != temp._end) - return false; - if (this._has_end != temp._has_end) - return false; - if (this._begin != temp._begin) - return false; - if (this._has_begin != temp._has_begin) - return false; if (this._seqRef != null) { if (temp._seqRef == null) return false; else if (!(this._seqRef.equals(temp._seqRef))) @@ -204,34 +87,6 @@ implements java.io.Serializable } 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._provenance != null) { if (temp._provenance == null) return false; else if (!(this._provenance.equals(temp._provenance))) @@ -245,98 +100,6 @@ implements java.io.Serializable } //-- 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 int - * @return the value of field 'begin'. - */ - public int getBegin() - { - return this._begin; - } //-- int 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 int - * @return the value of field 'end'. - */ - public int getEnd() - { - return this._end; - } //-- int 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() - - /** * Returns the value of field 'provenance'. * * @return Provenance @@ -348,7 +111,11 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Provenance getProvenance() /** - * Returns the value of field 'seqRef'. + * Returns the value of field 'seqRef'. The field 'seqRef' has + * the following description: annotation is associated + * with a particular dataset + * sequence + * * * @return Object * @return the value of field 'seqRef'. @@ -359,52 +126,6 @@ implements java.io.Serializable } //-- 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 hasBegin - * - * - * - * @return boolean - */ - public boolean hasBegin() - { - return this._has_begin; - } //-- boolean hasBegin() - - /** - * Method hasEnd - * - * - * - * @return boolean - */ - public boolean hasEnd() - { - return this._has_end; - } //-- boolean hasEnd() - - /** * Method isValid * * @@ -451,106 +172,6 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Method removeAllAnnotationElement - * - */ - public void removeAllAnnotationElement() - { - _annotationElementList.removeAllElements(); - } //-- void removeAllAnnotationElement() - - /** - * 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 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(int begin) - { - this._begin = begin; - this._has_begin = true; - } //-- void setBegin(int) - - /** - * 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(int end) - { - this._end = end; - this._has_end = true; - } //-- void setEnd(int) - - /** - * 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) - - /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. @@ -561,7 +182,11 @@ implements java.io.Serializable } //-- void setProvenance(org.vamsas.objects.core.Provenance) /** - * Sets the value of field 'seqRef'. + * Sets the value of field 'seqRef'. The field 'seqRef' has the + * following description: annotation is associated + * with a particular dataset + * sequence + * * * @param seqRef the value of field 'seqRef'. */ @@ -571,38 +196,18 @@ implements java.io.Serializable } //-- 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 DataSetAnnotations + * @return RangeType */ - public static org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader reader) + public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSetAnnotations.class, reader); - } //-- org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader) + } //-- org.vamsas.objects.core.RangeType unmarshal(java.io.Reader) /** * Method validate