X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fvamsas%2Fobjects%2Fcore%2FRangeAnnotation.java;h=df5cb2ef7cbac0fbf3682f008d0b8baaed64c21e;hb=8102c1325cac1288977f498c87924264d3037151;hp=57d7cc57857115fafbc9584b25ebdb2bdded8644;hpb=d4199f5cfea3a90baeb956c4beaa2f3e8c0597c6;p=vamsas.git diff --git a/src/org/vamsas/objects/core/RangeAnnotation.java b/src/org/vamsas/objects/core/RangeAnnotation.java index 57d7cc5..df5cb2e 100644 --- a/src/org/vamsas/objects/core/RangeAnnotation.java +++ b/src/org/vamsas/objects/core/RangeAnnotation.java @@ -1,1131 +1,1131 @@ -/* - * 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; - -/** - * Annotation for a rangeSpec - values can be attached for the - * whole specification, and to each position within the spec. - * following the orientation specified by the ordered set of - * rangeSpec (pos, seg) elements. - * - * - * @version $Revision$ $Date$ - */ -public class RangeAnnotation extends org.vamsas.objects.core.RangeType -implements java.io.Serializable -{ - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Primary Key for vamsas object referencing - * - */ - private java.lang.String _id; - - /** - * objects with modifiable=false will not be - * modified by a vamsas client update - * - */ - private boolean _modifiable = true; - - /** - * keeps track of state for field: _modifiable - */ - private boolean _has_modifiable; - - /** - * Annotation with the same non-empty group - * name are grouped together - * - */ - private java.lang.String _group = ""; - - /** - * A Das Feature has both a type and a Type ID. - * We go the route of requiring the type string - * to be taken from a controlled vocabulary if - * an application expects others to make sense - * of it. - * The type may qualified - so uniprot:CHAIN is a valid type - * name, - * and considered distinct from someotherDB:CHAIN - * - */ - private java.lang.String _type; - - /** - * Short, meaningful name for the annotation - if this is - * absent, then the type string should be used in its place. - * - */ - private java.lang.String _label; - - /** - * Human readable description of the annotation - * - */ - private java.lang.String _description; - - /** - * TODO: specify this - we have considered taking the GO - * evidence codes as a model for assessing a measure of quality - * to an annotation. - * - */ - private java.lang.String _status; - - /** - * Annotation Element position maps to - * ordered positions defined by the - * sequence of rangeType pos positions or - * concatenated seg start/end segments. - * - */ - private java.util.Vector _annotationElementList; - - /** - * Ordered set of optionally named float - * values for the whole annotation - * - */ - private java.util.Vector _scoreList; - - /** - * Field _linkList - */ - private java.util.Vector _linkList; - - /** - * Note:These are mutable so an application - * should check them each time. - * - */ - private java.util.Vector _propertyList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public RangeAnnotation() - { - super(); - setGroup(""); - _annotationElementList = new Vector(); - _scoreList = new Vector(); - _linkList = new Vector(); - _propertyList = new Vector(); - } //-- org.vamsas.objects.core.RangeAnnotation() - - - //-----------/ - //- 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 addLink - * - * - * - * @param vLink - */ - public void addLink(org.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - _linkList.addElement(vLink); - } //-- void addLink(org.vamsas.objects.core.Link) - - /** - * Method addLink - * - * - * - * @param index - * @param vLink - */ - public void addLink(int index, org.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - _linkList.insertElementAt(vLink, index); - } //-- void addLink(int, org.vamsas.objects.core.Link) - - /** - * Method addProperty - * - * - * - * @param vProperty - */ - public void addProperty(org.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(org.vamsas.objects.core.Property) - - /** - * Method addProperty - * - * - * - * @param index - * @param vProperty - */ - public void addProperty(int index, org.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, org.vamsas.objects.core.Property) - - /** - * Method addScore - * - * - * - * @param vScore - */ - public void addScore(org.vamsas.objects.core.Score vScore) - throws java.lang.IndexOutOfBoundsException - { - _scoreList.addElement(vScore); - } //-- void addScore(org.vamsas.objects.core.Score) - - /** - * Method addScore - * - * - * - * @param index - * @param vScore - */ - public void addScore(int index, org.vamsas.objects.core.Score vScore) - throws java.lang.IndexOutOfBoundsException - { - _scoreList.insertElementAt(vScore, index); - } //-- void addScore(int, org.vamsas.objects.core.Score) - - /** - * Method deleteModifiable - * - */ - public void deleteModifiable() - { - this._has_modifiable= false; - } //-- void deleteModifiable() - - /** - * Method enumerateAnnotationElement - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateAnnotationElement() - { - return _annotationElementList.elements(); - } //-- java.util.Enumeration enumerateAnnotationElement() - - /** - * Method enumerateLink - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateLink() - { - return _linkList.elements(); - } //-- java.util.Enumeration enumerateLink() - - /** - * Method enumerateProperty - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() - - /** - * Method enumerateScore - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateScore() - { - return _scoreList.elements(); - } //-- java.util.Enumeration enumerateScore() - - /** - * 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 RangeAnnotation) { - - RangeAnnotation temp = (RangeAnnotation)obj; - 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._modifiable != temp._modifiable) - return false; - if (this._has_modifiable != temp._has_modifiable) - return false; - if (this._group != null) { - if (temp._group == null) return false; - else if (!(this._group.equals(temp._group))) - return false; - } - else if (temp._group != null) - return false; - 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._label != null) { - if (temp._label == null) return false; - else if (!(this._label.equals(temp._label))) - return false; - } - else if (temp._label != 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._scoreList != null) { - if (temp._scoreList == null) return false; - else if (!(this._scoreList.equals(temp._scoreList))) - return false; - } - else if (temp._scoreList != null) - return false; - if (this._linkList != null) { - if (temp._linkList == null) return false; - else if (!(this._linkList.equals(temp._linkList))) - return false; - } - else if (temp._linkList != null) - return false; - if (this._propertyList != null) { - if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != 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 'description'. The field - * 'description' has the following description: Human readable - * description of the annotation - * - * - * @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 'group'. The field 'group' has - * the following description: Annotation with the same - * non-empty group - * name are grouped together - * - * - * @return String - * @return the value of field 'group'. - */ - public java.lang.String getGroup() - { - return this._group; - } //-- java.lang.String getGroup() - - /** - * Returns the value of field 'id'. The field 'id' has the - * following description: Primary Key for vamsas object - * referencing - * - * - * @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 'label'. The field 'label' has - * the following description: Short, meaningful name for the - * annotation - if this is absent, then the type string should - * be used in its place. - * - * - * @return String - * @return the value of field 'label'. - */ - public java.lang.String getLabel() - { - return this._label; - } //-- java.lang.String getLabel() - - /** - * Method getLink - * - * - * - * @param index - * @return Link - */ - public org.vamsas.objects.core.Link getLink(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _linkList.size())) { - throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); - } - - return (org.vamsas.objects.core.Link) _linkList.elementAt(index); - } //-- org.vamsas.objects.core.Link getLink(int) - - /** - * Method getLink - * - * - * - * @return Link - */ - public org.vamsas.objects.core.Link[] getLink() - { - int size = _linkList.size(); - org.vamsas.objects.core.Link[] mArray = new org.vamsas.objects.core.Link[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.Link) _linkList.elementAt(index); - } - return mArray; - } //-- org.vamsas.objects.core.Link[] getLink() - - /** - * Method getLinkCount - * - * - * - * @return int - */ - public int getLinkCount() - { - return _linkList.size(); - } //-- int getLinkCount() - - /** - * Returns the value of field 'modifiable'. The field - * 'modifiable' has the following description: objects with - * modifiable=false will not be - * modified by a vamsas client update - * - * - * @return boolean - * @return the value of field 'modifiable'. - */ - public boolean getModifiable() - { - return this._modifiable; - } //-- boolean getModifiable() - - /** - * Method getProperty - * - * - * - * @param index - * @return Property - */ - public org.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); - } - - return (org.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- org.vamsas.objects.core.Property getProperty(int) - - /** - * Method getProperty - * - * - * - * @return Property - */ - public org.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- org.vamsas.objects.core.Property[] getProperty() - - /** - * Method getPropertyCount - * - * - * - * @return int - */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() - - /** - * Method getScore - * - * - * - * @param index - * @return Score - */ - public org.vamsas.objects.core.Score getScore(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _scoreList.size())) { - throw new IndexOutOfBoundsException("getScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); - } - - return (org.vamsas.objects.core.Score) _scoreList.elementAt(index); - } //-- org.vamsas.objects.core.Score getScore(int) - - /** - * Method getScore - * - * - * - * @return Score - */ - public org.vamsas.objects.core.Score[] getScore() - { - int size = _scoreList.size(); - org.vamsas.objects.core.Score[] mArray = new org.vamsas.objects.core.Score[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.Score) _scoreList.elementAt(index); - } - return mArray; - } //-- org.vamsas.objects.core.Score[] getScore() - - /** - * Method getScoreCount - * - * - * - * @return int - */ - public int getScoreCount() - { - return _scoreList.size(); - } //-- int getScoreCount() - - /** - * Returns the value of field 'status'. The field 'status' has - * the following description: TODO: specify this - we have - * considered taking the GO evidence codes as a model for - * assessing a measure of quality to an annotation. - * - * - * @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'. The field 'type' has the - * following description: A Das Feature has both a type and a - * Type ID. - * We go the route of requiring the type string - * to be taken from a controlled vocabulary if - * an application expects others to make sense - * of it. - * The type may qualified - so uniprot:CHAIN is a valid type - * name, - * and considered distinct from someotherDB:CHAIN - * - * - * @return String - * @return the value of field 'type'. - */ - public java.lang.String getType() - { - return this._type; - } //-- java.lang.String getType() - - /** - * Method hasModifiable - * - * - * - * @return boolean - */ - public boolean hasModifiable() - { - return this._has_modifiable; - } //-- boolean hasModifiable() - - /** - * 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 removeAllLink - * - */ - public void removeAllLink() - { - _linkList.removeAllElements(); - } //-- void removeAllLink() - - /** - * Method removeAllProperty - * - */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() - - /** - * Method removeAllScore - * - */ - public void removeAllScore() - { - _scoreList.removeAllElements(); - } //-- void removeAllScore() - - /** - * 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 removeLink - * - * - * - * @param index - * @return Link - */ - public org.vamsas.objects.core.Link removeLink(int index) - { - java.lang.Object obj = _linkList.elementAt(index); - _linkList.removeElementAt(index); - return (org.vamsas.objects.core.Link) obj; - } //-- org.vamsas.objects.core.Link removeLink(int) - - /** - * Method removeProperty - * - * - * - * @param index - * @return Property - */ - public org.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); - return (org.vamsas.objects.core.Property) obj; - } //-- org.vamsas.objects.core.Property removeProperty(int) - - /** - * Method removeScore - * - * - * - * @param index - * @return Score - */ - public org.vamsas.objects.core.Score removeScore(int index) - { - java.lang.Object obj = _scoreList.elementAt(index); - _scoreList.removeElementAt(index); - return (org.vamsas.objects.core.Score) obj; - } //-- org.vamsas.objects.core.Score removeScore(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 'description'. The field - * 'description' has the following description: Human readable - * description of the annotation - * - * - * @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 'group'. The field 'group' has the - * following description: Annotation with the same non-empty - * group - * name are grouped together - * - * - * @param group the value of field 'group'. - */ - public void setGroup(java.lang.String group) - { - this._group = group; - } //-- void setGroup(java.lang.String) - - /** - * Sets the value of field 'id'. The field 'id' has the - * following description: Primary Key for vamsas object - * referencing - * - * - * @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 'label'. The field 'label' has the - * following description: Short, meaningful name for the - * annotation - if this is absent, then the type string should - * be used in its place. - * - * - * @param label the value of field 'label'. - */ - public void setLabel(java.lang.String label) - { - this._label = label; - } //-- void setLabel(java.lang.String) - - /** - * Method setLink - * - * - * - * @param index - * @param vLink - */ - public void setLink(int index, org.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _linkList.size())) { - throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); - } - _linkList.setElementAt(vLink, index); - } //-- void setLink(int, org.vamsas.objects.core.Link) - - /** - * Method setLink - * - * - * - * @param linkArray - */ - public void setLink(org.vamsas.objects.core.Link[] linkArray) - { - //-- copy array - _linkList.removeAllElements(); - for (int i = 0; i < linkArray.length; i++) { - _linkList.addElement(linkArray[i]); - } - } //-- void setLink(org.vamsas.objects.core.Link) - - /** - * Sets the value of field 'modifiable'. The field 'modifiable' - * has the following description: objects with modifiable=false - * will not be - * modified by a vamsas client update - * - * - * @param modifiable the value of field 'modifiable'. - */ - public void setModifiable(boolean modifiable) - { - this._modifiable = modifiable; - this._has_modifiable = true; - } //-- void setModifiable(boolean) - - /** - * Method setProperty - * - * - * - * @param index - * @param vProperty - */ - public void setProperty(int index, org.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); - } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, org.vamsas.objects.core.Property) - - /** - * Method setProperty - * - * - * - * @param propertyArray - */ - public void setProperty(org.vamsas.objects.core.Property[] propertyArray) - { - //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); - } - } //-- void setProperty(org.vamsas.objects.core.Property) - - /** - * Method setScore - * - * - * - * @param index - * @param vScore - */ - public void setScore(int index, org.vamsas.objects.core.Score vScore) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _scoreList.size())) { - throw new IndexOutOfBoundsException("setScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); - } - _scoreList.setElementAt(vScore, index); - } //-- void setScore(int, org.vamsas.objects.core.Score) - - /** - * Method setScore - * - * - * - * @param scoreArray - */ - public void setScore(org.vamsas.objects.core.Score[] scoreArray) - { - //-- copy array - _scoreList.removeAllElements(); - for (int i = 0; i < scoreArray.length; i++) { - _scoreList.addElement(scoreArray[i]); - } - } //-- void setScore(org.vamsas.objects.core.Score) - - /** - * Sets the value of field 'status'. The field 'status' has the - * following description: TODO: specify this - we have - * considered taking the GO evidence codes as a model for - * assessing a measure of quality to an annotation. - * - * - * @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'. The field 'type' has the - * following description: A Das Feature has both a type and a - * Type ID. - * We go the route of requiring the type string - * to be taken from a controlled vocabulary if - * an application expects others to make sense - * of it. - * The type may qualified - so uniprot:CHAIN is a valid type - * name, - * and considered distinct from someotherDB:CHAIN - * - * - * @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 RangeType - */ - 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.RangeAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.RangeAnnotation.class, reader); - } //-- org.vamsas.objects.core.RangeType 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() - -} +/* + * 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; + +/** + * Annotation for a rangeSpec - values can be attached for the + * whole specification, and to each position within the spec. + * following the orientation specified by the ordered set of + * rangeSpec (pos, seg) elements. + * + * + * @version $Revision$ $Date$ + */ +public class RangeAnnotation extends org.vamsas.objects.core.RangeType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * objects with modifiable=false will not be + * modified by a vamsas client update + * + */ + private boolean _modifiable = true; + + /** + * keeps track of state for field: _modifiable + */ + private boolean _has_modifiable; + + /** + * Annotation with the same non-empty group + * name are grouped together + * + */ + private java.lang.String _group = ""; + + /** + * A Das Feature has both a type and a Type ID. + * We go the route of requiring the type string + * to be taken from a controlled vocabulary if + * an application expects others to make sense + * of it. + * The type may qualified - so uniprot:CHAIN is a valid type + * name, + * and considered distinct from someotherDB:CHAIN + * + */ + private java.lang.String _type; + + /** + * Short, meaningful name for the annotation - if this is + * absent, then the type string should be used in its place. + * + */ + private java.lang.String _label; + + /** + * Human readable description of the annotation + * + */ + private java.lang.String _description; + + /** + * TODO: specify this - we have considered taking the GO + * evidence codes as a model for assessing a measure of quality + * to an annotation. + * + */ + private java.lang.String _status; + + /** + * Annotation Element position maps to + * ordered positions defined by the + * sequence of rangeType pos positions or + * concatenated seg start/end segments. + * + */ + private java.util.Vector _annotationElementList; + + /** + * Ordered set of optionally named float + * values for the whole annotation + * + */ + private java.util.Vector _scoreList; + + /** + * Field _linkList + */ + private java.util.Vector _linkList; + + /** + * Note:These are mutable so an application + * should check them each time. + * + */ + private java.util.Vector _propertyList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public RangeAnnotation() + { + super(); + setGroup(""); + _annotationElementList = new Vector(); + _scoreList = new Vector(); + _linkList = new Vector(); + _propertyList = new Vector(); + } //-- org.vamsas.objects.core.RangeAnnotation() + + + //-----------/ + //- 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 addLink + * + * + * + * @param vLink + */ + public void addLink(org.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.addElement(vLink); + } //-- void addLink(org.vamsas.objects.core.Link) + + /** + * Method addLink + * + * + * + * @param index + * @param vLink + */ + public void addLink(int index, org.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.insertElementAt(vLink, index); + } //-- void addLink(int, org.vamsas.objects.core.Link) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.vamsas.objects.core.Property) + + /** + * Method addScore + * + * + * + * @param vScore + */ + public void addScore(org.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + _scoreList.addElement(vScore); + } //-- void addScore(org.vamsas.objects.core.Score) + + /** + * Method addScore + * + * + * + * @param index + * @param vScore + */ + public void addScore(int index, org.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + _scoreList.insertElementAt(vScore, index); + } //-- void addScore(int, org.vamsas.objects.core.Score) + + /** + * Method deleteModifiable + * + */ + public void deleteModifiable() + { + this._has_modifiable= false; + } //-- void deleteModifiable() + + /** + * Method enumerateAnnotationElement + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAnnotationElement() + { + return _annotationElementList.elements(); + } //-- java.util.Enumeration enumerateAnnotationElement() + + /** + * Method enumerateLink + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateLink() + { + return _linkList.elements(); + } //-- java.util.Enumeration enumerateLink() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Method enumerateScore + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateScore() + { + return _scoreList.elements(); + } //-- java.util.Enumeration enumerateScore() + + /** + * 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 RangeAnnotation) { + + RangeAnnotation temp = (RangeAnnotation)obj; + 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._modifiable != temp._modifiable) + return false; + if (this._has_modifiable != temp._has_modifiable) + return false; + if (this._group != null) { + if (temp._group == null) return false; + else if (!(this._group.equals(temp._group))) + return false; + } + else if (temp._group != null) + return false; + 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._label != null) { + if (temp._label == null) return false; + else if (!(this._label.equals(temp._label))) + return false; + } + else if (temp._label != 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._scoreList != null) { + if (temp._scoreList == null) return false; + else if (!(this._scoreList.equals(temp._scoreList))) + return false; + } + else if (temp._scoreList != null) + return false; + if (this._linkList != null) { + if (temp._linkList == null) return false; + else if (!(this._linkList.equals(temp._linkList))) + return false; + } + else if (temp._linkList != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + else if (temp._propertyList != 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 'description'. The field + * 'description' has the following description: Human readable + * description of the annotation + * + * + * @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 'group'. The field 'group' has + * the following description: Annotation with the same + * non-empty group + * name are grouped together + * + * + * @return String + * @return the value of field 'group'. + */ + public java.lang.String getGroup() + { + return this._group; + } //-- java.lang.String getGroup() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'label'. The field 'label' has + * the following description: Short, meaningful name for the + * annotation - if this is absent, then the type string should + * be used in its place. + * + * + * @return String + * @return the value of field 'label'. + */ + public java.lang.String getLabel() + { + return this._label; + } //-- java.lang.String getLabel() + + /** + * Method getLink + * + * + * + * @param index + * @return Link + */ + public org.vamsas.objects.core.Link getLink(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _linkList.size())) { + throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + } + + return (org.vamsas.objects.core.Link) _linkList.elementAt(index); + } //-- org.vamsas.objects.core.Link getLink(int) + + /** + * Method getLink + * + * + * + * @return Link + */ + public org.vamsas.objects.core.Link[] getLink() + { + int size = _linkList.size(); + org.vamsas.objects.core.Link[] mArray = new org.vamsas.objects.core.Link[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Link) _linkList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Link[] getLink() + + /** + * Method getLinkCount + * + * + * + * @return int + */ + public int getLinkCount() + { + return _linkList.size(); + } //-- int getLinkCount() + + /** + * Returns the value of field 'modifiable'. The field + * 'modifiable' has the following description: objects with + * modifiable=false will not be + * modified by a vamsas client update + * + * + * @return boolean + * @return the value of field 'modifiable'. + */ + public boolean getModifiable() + { + return this._modifiable; + } //-- boolean getModifiable() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Method getScore + * + * + * + * @param index + * @return Score + */ + public org.vamsas.objects.core.Score getScore(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _scoreList.size())) { + throw new IndexOutOfBoundsException("getScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); + } + + return (org.vamsas.objects.core.Score) _scoreList.elementAt(index); + } //-- org.vamsas.objects.core.Score getScore(int) + + /** + * Method getScore + * + * + * + * @return Score + */ + public org.vamsas.objects.core.Score[] getScore() + { + int size = _scoreList.size(); + org.vamsas.objects.core.Score[] mArray = new org.vamsas.objects.core.Score[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Score) _scoreList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Score[] getScore() + + /** + * Method getScoreCount + * + * + * + * @return int + */ + public int getScoreCount() + { + return _scoreList.size(); + } //-- int getScoreCount() + + /** + * Returns the value of field 'status'. The field 'status' has + * the following description: TODO: specify this - we have + * considered taking the GO evidence codes as a model for + * assessing a measure of quality to an annotation. + * + * + * @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'. The field 'type' has the + * following description: A Das Feature has both a type and a + * Type ID. + * We go the route of requiring the type string + * to be taken from a controlled vocabulary if + * an application expects others to make sense + * of it. + * The type may qualified - so uniprot:CHAIN is a valid type + * name, + * and considered distinct from someotherDB:CHAIN + * + * + * @return String + * @return the value of field 'type'. + */ + public java.lang.String getType() + { + return this._type; + } //-- java.lang.String getType() + + /** + * Method hasModifiable + * + * + * + * @return boolean + */ + public boolean hasModifiable() + { + return this._has_modifiable; + } //-- boolean hasModifiable() + + /** + * 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 removeAllLink + * + */ + public void removeAllLink() + { + _linkList.removeAllElements(); + } //-- void removeAllLink() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeAllScore + * + */ + public void removeAllScore() + { + _scoreList.removeAllElements(); + } //-- void removeAllScore() + + /** + * 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 removeLink + * + * + * + * @param index + * @return Link + */ + public org.vamsas.objects.core.Link removeLink(int index) + { + java.lang.Object obj = _linkList.elementAt(index); + _linkList.removeElementAt(index); + return (org.vamsas.objects.core.Link) obj; + } //-- org.vamsas.objects.core.Link removeLink(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.vamsas.objects.core.Property removeProperty(int) + + /** + * Method removeScore + * + * + * + * @param index + * @return Score + */ + public org.vamsas.objects.core.Score removeScore(int index) + { + java.lang.Object obj = _scoreList.elementAt(index); + _scoreList.removeElementAt(index); + return (org.vamsas.objects.core.Score) obj; + } //-- org.vamsas.objects.core.Score removeScore(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 'description'. The field + * 'description' has the following description: Human readable + * description of the annotation + * + * + * @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 'group'. The field 'group' has the + * following description: Annotation with the same non-empty + * group + * name are grouped together + * + * + * @param group the value of field 'group'. + */ + public void setGroup(java.lang.String group) + { + this._group = group; + } //-- void setGroup(java.lang.String) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'label'. The field 'label' has the + * following description: Short, meaningful name for the + * annotation - if this is absent, then the type string should + * be used in its place. + * + * + * @param label the value of field 'label'. + */ + public void setLabel(java.lang.String label) + { + this._label = label; + } //-- void setLabel(java.lang.String) + + /** + * Method setLink + * + * + * + * @param index + * @param vLink + */ + public void setLink(int index, org.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _linkList.size())) { + throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + } + _linkList.setElementAt(vLink, index); + } //-- void setLink(int, org.vamsas.objects.core.Link) + + /** + * Method setLink + * + * + * + * @param linkArray + */ + public void setLink(org.vamsas.objects.core.Link[] linkArray) + { + //-- copy array + _linkList.removeAllElements(); + for (int i = 0; i < linkArray.length; i++) { + _linkList.addElement(linkArray[i]); + } + } //-- void setLink(org.vamsas.objects.core.Link) + + /** + * Sets the value of field 'modifiable'. The field 'modifiable' + * has the following description: objects with modifiable=false + * will not be + * modified by a vamsas client update + * + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(boolean modifiable) + { + this._modifiable = modifiable; + this._has_modifiable = true; + } //-- void setModifiable(boolean) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.vamsas.objects.core.Property) + + /** + * Method setScore + * + * + * + * @param index + * @param vScore + */ + public void setScore(int index, org.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _scoreList.size())) { + throw new IndexOutOfBoundsException("setScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); + } + _scoreList.setElementAt(vScore, index); + } //-- void setScore(int, org.vamsas.objects.core.Score) + + /** + * Method setScore + * + * + * + * @param scoreArray + */ + public void setScore(org.vamsas.objects.core.Score[] scoreArray) + { + //-- copy array + _scoreList.removeAllElements(); + for (int i = 0; i < scoreArray.length; i++) { + _scoreList.addElement(scoreArray[i]); + } + } //-- void setScore(org.vamsas.objects.core.Score) + + /** + * Sets the value of field 'status'. The field 'status' has the + * following description: TODO: specify this - we have + * considered taking the GO evidence codes as a model for + * assessing a measure of quality to an annotation. + * + * + * @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'. The field 'type' has the + * following description: A Das Feature has both a type and a + * Type ID. + * We go the route of requiring the type string + * to be taken from a controlled vocabulary if + * an application expects others to make sense + * of it. + * The type may qualified - so uniprot:CHAIN is a valid type + * name, + * and considered distinct from someotherDB:CHAIN + * + * + * @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 RangeType + */ + 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.RangeAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.RangeAnnotation.class, reader); + } //-- org.vamsas.objects.core.RangeType 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() + +}