2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
27 * Annotation for a rangeSpec - values can be attached for the
28 * whole specification, and to each position within the spec.
29 * following the orientation specified by the ordered set of
30 * rangeSpec (pos, seg) elements.
33 * @version $Revision$ $Date$
35 public class RangeAnnotation extends org.vamsas.objects.core.RangeType
36 implements java.io.Serializable
40 //--------------------------/
41 //- Class/Member Variables -/
42 //--------------------------/
45 * Primary Key for vamsas object referencing
48 private java.lang.String _id;
51 * objects with modifiable=false will not be
52 * modified by a vamsas client update
55 private boolean _modifiable = true;
58 * keeps track of state for field: _modifiable
60 private boolean _has_modifiable;
63 * Annotation with the same non-empty group
64 * name are grouped together
67 private java.lang.String _group = "";
70 * A Das Feature has both a type and a Type ID.
71 * We go the route of requiring the type string
72 * to be taken from a controlled vocabulary if
73 * an application expects others to make sense
75 * The type may qualified - so uniprot:CHAIN is a valid type
77 * and considered distinct from someotherDB:CHAIN
80 private java.lang.String _type;
83 * Short, meaningful name for the annotation - if this is
84 * absent, then the type string should be used in its place.
87 private java.lang.String _label;
90 * Human readable description of the annotation
93 private java.lang.String _description;
96 * TODO: specify this - we have considered taking the GO
97 * evidence codes as a model for assessing a measure of quality
101 private java.lang.String _status;
104 * Annotation Element position maps to
105 * ordered positions defined by the
106 * sequence of rangeType pos positions or
107 * concatenated seg start/end segments.
110 private java.util.Vector _annotationElementList;
113 * Ordered set of optionally named float
114 * values for the whole annotation
117 private java.util.Vector _scoreList;
122 private java.util.Vector _linkList;
125 * Note:These are mutable so an application
126 * should check them each time.
129 private java.util.Vector _propertyList;
136 public RangeAnnotation()
140 _annotationElementList = new Vector();
141 _scoreList = new Vector();
142 _linkList = new Vector();
143 _propertyList = new Vector();
144 } //-- org.vamsas.objects.core.RangeAnnotation()
152 * Method addAnnotationElement
156 * @param vAnnotationElement
158 public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
159 throws java.lang.IndexOutOfBoundsException
161 _annotationElementList.addElement(vAnnotationElement);
162 } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement)
165 * Method addAnnotationElement
170 * @param vAnnotationElement
172 public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
173 throws java.lang.IndexOutOfBoundsException
175 _annotationElementList.insertElementAt(vAnnotationElement, index);
176 } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
185 public void addLink(org.vamsas.objects.core.Link vLink)
186 throws java.lang.IndexOutOfBoundsException
188 _linkList.addElement(vLink);
189 } //-- void addLink(org.vamsas.objects.core.Link)
199 public void addLink(int index, org.vamsas.objects.core.Link vLink)
200 throws java.lang.IndexOutOfBoundsException
202 _linkList.insertElementAt(vLink, index);
203 } //-- void addLink(int, org.vamsas.objects.core.Link)
212 public void addProperty(org.vamsas.objects.core.Property vProperty)
213 throws java.lang.IndexOutOfBoundsException
215 _propertyList.addElement(vProperty);
216 } //-- void addProperty(org.vamsas.objects.core.Property)
226 public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
227 throws java.lang.IndexOutOfBoundsException
229 _propertyList.insertElementAt(vProperty, index);
230 } //-- void addProperty(int, org.vamsas.objects.core.Property)
239 public void addScore(org.vamsas.objects.core.Score vScore)
240 throws java.lang.IndexOutOfBoundsException
242 _scoreList.addElement(vScore);
243 } //-- void addScore(org.vamsas.objects.core.Score)
253 public void addScore(int index, org.vamsas.objects.core.Score vScore)
254 throws java.lang.IndexOutOfBoundsException
256 _scoreList.insertElementAt(vScore, index);
257 } //-- void addScore(int, org.vamsas.objects.core.Score)
260 * Method deleteModifiable
263 public void deleteModifiable()
265 this._has_modifiable= false;
266 } //-- void deleteModifiable()
269 * Method enumerateAnnotationElement
273 * @return Enumeration
275 public java.util.Enumeration enumerateAnnotationElement()
277 return _annotationElementList.elements();
278 } //-- java.util.Enumeration enumerateAnnotationElement()
281 * Method enumerateLink
285 * @return Enumeration
287 public java.util.Enumeration enumerateLink()
289 return _linkList.elements();
290 } //-- java.util.Enumeration enumerateLink()
293 * Method enumerateProperty
297 * @return Enumeration
299 public java.util.Enumeration enumerateProperty()
301 return _propertyList.elements();
302 } //-- java.util.Enumeration enumerateProperty()
305 * Method enumerateScore
309 * @return Enumeration
311 public java.util.Enumeration enumerateScore()
313 return _scoreList.elements();
314 } //-- java.util.Enumeration enumerateScore()
317 * Note: hashCode() has not been overriden
322 public boolean equals(java.lang.Object obj)
327 if (super.equals(obj)==false)
330 if (obj instanceof RangeAnnotation) {
332 RangeAnnotation temp = (RangeAnnotation)obj;
333 if (this._id != null) {
334 if (temp._id == null) return false;
335 else if (!(this._id.equals(temp._id)))
338 else if (temp._id != null)
340 if (this._modifiable != temp._modifiable)
342 if (this._has_modifiable != temp._has_modifiable)
344 if (this._group != null) {
345 if (temp._group == null) return false;
346 else if (!(this._group.equals(temp._group)))
349 else if (temp._group != null)
351 if (this._type != null) {
352 if (temp._type == null) return false;
353 else if (!(this._type.equals(temp._type)))
356 else if (temp._type != null)
358 if (this._label != null) {
359 if (temp._label == null) return false;
360 else if (!(this._label.equals(temp._label)))
363 else if (temp._label != null)
365 if (this._description != null) {
366 if (temp._description == null) return false;
367 else if (!(this._description.equals(temp._description)))
370 else if (temp._description != null)
372 if (this._status != null) {
373 if (temp._status == null) return false;
374 else if (!(this._status.equals(temp._status)))
377 else if (temp._status != null)
379 if (this._annotationElementList != null) {
380 if (temp._annotationElementList == null) return false;
381 else if (!(this._annotationElementList.equals(temp._annotationElementList)))
384 else if (temp._annotationElementList != null)
386 if (this._scoreList != null) {
387 if (temp._scoreList == null) return false;
388 else if (!(this._scoreList.equals(temp._scoreList)))
391 else if (temp._scoreList != null)
393 if (this._linkList != null) {
394 if (temp._linkList == null) return false;
395 else if (!(this._linkList.equals(temp._linkList)))
398 else if (temp._linkList != null)
400 if (this._propertyList != null) {
401 if (temp._propertyList == null) return false;
402 else if (!(this._propertyList.equals(temp._propertyList)))
405 else if (temp._propertyList != null)
410 } //-- boolean equals(java.lang.Object)
413 * Method getAnnotationElement
418 * @return AnnotationElement
420 public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
421 throws java.lang.IndexOutOfBoundsException
423 //-- check bounds for index
424 if ((index < 0) || (index > _annotationElementList.size())) {
425 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
428 return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
429 } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int)
432 * Method getAnnotationElement
436 * @return AnnotationElement
438 public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
440 int size = _annotationElementList.size();
441 org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
442 for (int index = 0; index < size; index++) {
443 mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
446 } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
449 * Method getAnnotationElementCount
455 public int getAnnotationElementCount()
457 return _annotationElementList.size();
458 } //-- int getAnnotationElementCount()
461 * Returns the value of field 'description'. The field
462 * 'description' has the following description: Human readable
463 * description of the annotation
467 * @return the value of field 'description'.
469 public java.lang.String getDescription()
471 return this._description;
472 } //-- java.lang.String getDescription()
475 * Returns the value of field 'group'. The field 'group' has
476 * the following description: Annotation with the same
478 * name are grouped together
482 * @return the value of field 'group'.
484 public java.lang.String getGroup()
487 } //-- java.lang.String getGroup()
490 * Returns the value of field 'id'. The field 'id' has the
491 * following description: Primary Key for vamsas object
496 * @return the value of field 'id'.
498 public java.lang.String getId()
501 } //-- java.lang.String getId()
504 * Returns the value of field 'label'. The field 'label' has
505 * the following description: Short, meaningful name for the
506 * annotation - if this is absent, then the type string should
507 * be used in its place.
511 * @return the value of field 'label'.
513 public java.lang.String getLabel()
516 } //-- java.lang.String getLabel()
526 public org.vamsas.objects.core.Link getLink(int index)
527 throws java.lang.IndexOutOfBoundsException
529 //-- check bounds for index
530 if ((index < 0) || (index > _linkList.size())) {
531 throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]");
534 return (org.vamsas.objects.core.Link) _linkList.elementAt(index);
535 } //-- org.vamsas.objects.core.Link getLink(int)
544 public org.vamsas.objects.core.Link[] getLink()
546 int size = _linkList.size();
547 org.vamsas.objects.core.Link[] mArray = new org.vamsas.objects.core.Link[size];
548 for (int index = 0; index < size; index++) {
549 mArray[index] = (org.vamsas.objects.core.Link) _linkList.elementAt(index);
552 } //-- org.vamsas.objects.core.Link[] getLink()
555 * Method getLinkCount
561 public int getLinkCount()
563 return _linkList.size();
564 } //-- int getLinkCount()
567 * Returns the value of field 'modifiable'. The field
568 * 'modifiable' has the following description: objects with
569 * modifiable=false will not be
570 * modified by a vamsas client update
574 * @return the value of field 'modifiable'.
576 public boolean getModifiable()
578 return this._modifiable;
579 } //-- boolean getModifiable()
589 public org.vamsas.objects.core.Property getProperty(int index)
590 throws java.lang.IndexOutOfBoundsException
592 //-- check bounds for index
593 if ((index < 0) || (index > _propertyList.size())) {
594 throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
597 return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
598 } //-- org.vamsas.objects.core.Property getProperty(int)
607 public org.vamsas.objects.core.Property[] getProperty()
609 int size = _propertyList.size();
610 org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
611 for (int index = 0; index < size; index++) {
612 mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
615 } //-- org.vamsas.objects.core.Property[] getProperty()
618 * Method getPropertyCount
624 public int getPropertyCount()
626 return _propertyList.size();
627 } //-- int getPropertyCount()
637 public org.vamsas.objects.core.Score getScore(int index)
638 throws java.lang.IndexOutOfBoundsException
640 //-- check bounds for index
641 if ((index < 0) || (index > _scoreList.size())) {
642 throw new IndexOutOfBoundsException("getScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]");
645 return (org.vamsas.objects.core.Score) _scoreList.elementAt(index);
646 } //-- org.vamsas.objects.core.Score getScore(int)
655 public org.vamsas.objects.core.Score[] getScore()
657 int size = _scoreList.size();
658 org.vamsas.objects.core.Score[] mArray = new org.vamsas.objects.core.Score[size];
659 for (int index = 0; index < size; index++) {
660 mArray[index] = (org.vamsas.objects.core.Score) _scoreList.elementAt(index);
663 } //-- org.vamsas.objects.core.Score[] getScore()
666 * Method getScoreCount
672 public int getScoreCount()
674 return _scoreList.size();
675 } //-- int getScoreCount()
678 * Returns the value of field 'status'. The field 'status' has
679 * the following description: TODO: specify this - we have
680 * considered taking the GO evidence codes as a model for
681 * assessing a measure of quality to an annotation.
685 * @return the value of field 'status'.
687 public java.lang.String getStatus()
690 } //-- java.lang.String getStatus()
693 * Returns the value of field 'type'. The field 'type' has the
694 * following description: A Das Feature has both a type and a
696 * We go the route of requiring the type string
697 * to be taken from a controlled vocabulary if
698 * an application expects others to make sense
700 * The type may qualified - so uniprot:CHAIN is a valid type
702 * and considered distinct from someotherDB:CHAIN
706 * @return the value of field 'type'.
708 public java.lang.String getType()
711 } //-- java.lang.String getType()
714 * Method hasModifiable
720 public boolean hasModifiable()
722 return this._has_modifiable;
723 } //-- boolean hasModifiable()
732 public boolean isValid()
737 catch (org.exolab.castor.xml.ValidationException vex) {
741 } //-- boolean isValid()
750 public void marshal(java.io.Writer out)
751 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
754 Marshaller.marshal(this, out);
755 } //-- void marshal(java.io.Writer)
764 public void marshal(org.xml.sax.ContentHandler handler)
765 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
768 Marshaller.marshal(this, handler);
769 } //-- void marshal(org.xml.sax.ContentHandler)
772 * Method removeAllAnnotationElement
775 public void removeAllAnnotationElement()
777 _annotationElementList.removeAllElements();
778 } //-- void removeAllAnnotationElement()
781 * Method removeAllLink
784 public void removeAllLink()
786 _linkList.removeAllElements();
787 } //-- void removeAllLink()
790 * Method removeAllProperty
793 public void removeAllProperty()
795 _propertyList.removeAllElements();
796 } //-- void removeAllProperty()
799 * Method removeAllScore
802 public void removeAllScore()
804 _scoreList.removeAllElements();
805 } //-- void removeAllScore()
808 * Method removeAnnotationElement
813 * @return AnnotationElement
815 public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
817 java.lang.Object obj = _annotationElementList.elementAt(index);
818 _annotationElementList.removeElementAt(index);
819 return (org.vamsas.objects.core.AnnotationElement) obj;
820 } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
830 public org.vamsas.objects.core.Link removeLink(int index)
832 java.lang.Object obj = _linkList.elementAt(index);
833 _linkList.removeElementAt(index);
834 return (org.vamsas.objects.core.Link) obj;
835 } //-- org.vamsas.objects.core.Link removeLink(int)
838 * Method removeProperty
845 public org.vamsas.objects.core.Property removeProperty(int index)
847 java.lang.Object obj = _propertyList.elementAt(index);
848 _propertyList.removeElementAt(index);
849 return (org.vamsas.objects.core.Property) obj;
850 } //-- org.vamsas.objects.core.Property removeProperty(int)
860 public org.vamsas.objects.core.Score removeScore(int index)
862 java.lang.Object obj = _scoreList.elementAt(index);
863 _scoreList.removeElementAt(index);
864 return (org.vamsas.objects.core.Score) obj;
865 } //-- org.vamsas.objects.core.Score removeScore(int)
868 * Method setAnnotationElement
873 * @param vAnnotationElement
875 public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
876 throws java.lang.IndexOutOfBoundsException
878 //-- check bounds for index
879 if ((index < 0) || (index > _annotationElementList.size())) {
880 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
882 _annotationElementList.setElementAt(vAnnotationElement, index);
883 } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
886 * Method setAnnotationElement
890 * @param annotationElementArray
892 public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
895 _annotationElementList.removeAllElements();
896 for (int i = 0; i < annotationElementArray.length; i++) {
897 _annotationElementList.addElement(annotationElementArray[i]);
899 } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement)
902 * Sets the value of field 'description'. The field
903 * 'description' has the following description: Human readable
904 * description of the annotation
907 * @param description the value of field 'description'.
909 public void setDescription(java.lang.String description)
911 this._description = description;
912 } //-- void setDescription(java.lang.String)
915 * Sets the value of field 'group'. The field 'group' has the
916 * following description: Annotation with the same non-empty
918 * name are grouped together
921 * @param group the value of field 'group'.
923 public void setGroup(java.lang.String group)
926 } //-- void setGroup(java.lang.String)
929 * Sets the value of field 'id'. The field 'id' has the
930 * following description: Primary Key for vamsas object
934 * @param id the value of field 'id'.
936 public void setId(java.lang.String id)
939 } //-- void setId(java.lang.String)
942 * Sets the value of field 'label'. The field 'label' has the
943 * following description: Short, meaningful name for the
944 * annotation - if this is absent, then the type string should
945 * be used in its place.
948 * @param label the value of field 'label'.
950 public void setLabel(java.lang.String label)
953 } //-- void setLabel(java.lang.String)
963 public void setLink(int index, org.vamsas.objects.core.Link vLink)
964 throws java.lang.IndexOutOfBoundsException
966 //-- check bounds for index
967 if ((index < 0) || (index > _linkList.size())) {
968 throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]");
970 _linkList.setElementAt(vLink, index);
971 } //-- void setLink(int, org.vamsas.objects.core.Link)
980 public void setLink(org.vamsas.objects.core.Link[] linkArray)
983 _linkList.removeAllElements();
984 for (int i = 0; i < linkArray.length; i++) {
985 _linkList.addElement(linkArray[i]);
987 } //-- void setLink(org.vamsas.objects.core.Link)
990 * Sets the value of field 'modifiable'. The field 'modifiable'
991 * has the following description: objects with modifiable=false
993 * modified by a vamsas client update
996 * @param modifiable the value of field 'modifiable'.
998 public void setModifiable(boolean modifiable)
1000 this._modifiable = modifiable;
1001 this._has_modifiable = true;
1002 } //-- void setModifiable(boolean)
1005 * Method setProperty
1012 public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
1013 throws java.lang.IndexOutOfBoundsException
1015 //-- check bounds for index
1016 if ((index < 0) || (index > _propertyList.size())) {
1017 throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
1019 _propertyList.setElementAt(vProperty, index);
1020 } //-- void setProperty(int, org.vamsas.objects.core.Property)
1023 * Method setProperty
1027 * @param propertyArray
1029 public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
1032 _propertyList.removeAllElements();
1033 for (int i = 0; i < propertyArray.length; i++) {
1034 _propertyList.addElement(propertyArray[i]);
1036 } //-- void setProperty(org.vamsas.objects.core.Property)
1046 public void setScore(int index, org.vamsas.objects.core.Score vScore)
1047 throws java.lang.IndexOutOfBoundsException
1049 //-- check bounds for index
1050 if ((index < 0) || (index > _scoreList.size())) {
1051 throw new IndexOutOfBoundsException("setScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]");
1053 _scoreList.setElementAt(vScore, index);
1054 } //-- void setScore(int, org.vamsas.objects.core.Score)
1063 public void setScore(org.vamsas.objects.core.Score[] scoreArray)
1066 _scoreList.removeAllElements();
1067 for (int i = 0; i < scoreArray.length; i++) {
1068 _scoreList.addElement(scoreArray[i]);
1070 } //-- void setScore(org.vamsas.objects.core.Score)
1073 * Sets the value of field 'status'. The field 'status' has the
1074 * following description: TODO: specify this - we have
1075 * considered taking the GO evidence codes as a model for
1076 * assessing a measure of quality to an annotation.
1079 * @param status the value of field 'status'.
1081 public void setStatus(java.lang.String status)
1083 this._status = status;
1084 } //-- void setStatus(java.lang.String)
1087 * Sets the value of field 'type'. The field 'type' has the
1088 * following description: A Das Feature has both a type and a
1090 * We go the route of requiring the type string
1091 * to be taken from a controlled vocabulary if
1092 * an application expects others to make sense
1094 * The type may qualified - so uniprot:CHAIN is a valid type
1096 * and considered distinct from someotherDB:CHAIN
1099 * @param type the value of field 'type'.
1101 public void setType(java.lang.String type)
1104 } //-- void setType(java.lang.String)
1114 public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader)
1115 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
1117 return (org.vamsas.objects.core.RangeAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.RangeAnnotation.class, reader);
1118 } //-- org.vamsas.objects.core.RangeType unmarshal(java.io.Reader)
1124 public void validate()
1125 throws org.exolab.castor.xml.ValidationException
1127 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1128 validator.validate(this);
1129 } //-- void validate()