2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Annotation implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
32 private boolean _graph;
35 * keeps track of state for field: _graph
37 private boolean _has_graph;
42 private int _graphType;
45 * keeps track of state for field: _graphType
47 private boolean _has_graphType;
52 private java.lang.String _sequenceRef;
57 private java.lang.String _groupRef;
62 private int _graphColour;
65 * keeps track of state for field: _graphColour
67 private boolean _has_graphColour;
72 private int _graphGroup;
75 * keeps track of state for field: _graphGroup
77 private boolean _has_graphGroup;
80 * height in pixels for the graph if this is a graph-type
83 private int _graphHeight;
86 * keeps track of state for field: _graphHeight
88 private boolean _has_graphHeight;
93 private java.lang.String _id;
98 private boolean _scoreOnly = false;
101 * keeps track of state for field: _scoreOnly
103 private boolean _has_scoreOnly;
108 private double _score;
111 * keeps track of state for field: _score
113 private boolean _has_score;
118 private boolean _visible;
121 * keeps track of state for field: _visible
123 private boolean _has_visible;
126 * Field _centreColLabels.
128 private boolean _centreColLabels;
131 * keeps track of state for field: _centreColLabels
133 private boolean _has_centreColLabels;
136 * Field _scaleColLabels.
138 private boolean _scaleColLabels;
141 * keeps track of state for field: _scaleColLabels
143 private boolean _has_scaleColLabels;
146 * Field _showAllColLabels.
148 private boolean _showAllColLabels;
151 * keeps track of state for field: _showAllColLabels
153 private boolean _has_showAllColLabels;
156 * is an autocalculated annotation row
158 private boolean _autoCalculated = false;
161 * keeps track of state for field: _autoCalculated
163 private boolean _has_autoCalculated;
166 * Field _annotationElementList.
168 private java.util.Vector _annotationElementList;
173 private java.lang.String _label;
176 * Field _description.
178 private java.lang.String _description;
181 * Field _thresholdLine.
183 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
190 public Annotation() {
192 this._annotationElementList = new java.util.Vector();
203 * @param vAnnotationElement
204 * @throws java.lang.IndexOutOfBoundsException if the index
205 * given is outside the bounds of the collection
207 public void addAnnotationElement(
208 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
209 throws java.lang.IndexOutOfBoundsException {
210 this._annotationElementList.addElement(vAnnotationElement);
217 * @param vAnnotationElement
218 * @throws java.lang.IndexOutOfBoundsException if the index
219 * given is outside the bounds of the collection
221 public void addAnnotationElement(
223 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
224 throws java.lang.IndexOutOfBoundsException {
225 this._annotationElementList.add(index, vAnnotationElement);
230 public void deleteAutoCalculated(
232 this._has_autoCalculated= false;
237 public void deleteCentreColLabels(
239 this._has_centreColLabels= false;
244 public void deleteGraph(
246 this._has_graph= false;
251 public void deleteGraphColour(
253 this._has_graphColour= false;
258 public void deleteGraphGroup(
260 this._has_graphGroup= false;
265 public void deleteGraphHeight(
267 this._has_graphHeight= false;
272 public void deleteGraphType(
274 this._has_graphType= false;
279 public void deleteScaleColLabels(
281 this._has_scaleColLabels= false;
286 public void deleteScore(
288 this._has_score= false;
293 public void deleteScoreOnly(
295 this._has_scoreOnly= false;
300 public void deleteShowAllColLabels(
302 this._has_showAllColLabels= false;
307 public void deleteVisible(
309 this._has_visible= false;
313 * Method enumerateAnnotationElement.
315 * @return an Enumeration over all
316 * jalview.schemabinding.version2.AnnotationElement elements
318 public java.util.Enumeration enumerateAnnotationElement(
320 return this._annotationElementList.elements();
324 * Method getAnnotationElement.
327 * @throws java.lang.IndexOutOfBoundsException if the index
328 * given is outside the bounds of the collection
329 * @return the value of the
330 * jalview.schemabinding.version2.AnnotationElement at the
333 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
335 throws java.lang.IndexOutOfBoundsException {
336 // check bounds for index
337 if (index < 0 || index >= this._annotationElementList.size()) {
338 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
341 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.get(index);
345 * Method getAnnotationElement.Returns the contents of the
346 * collection in an Array. <p>Note: Just in case the
347 * collection contents are changing in another thread, we pass
348 * a 0-length Array of the correct type into the API call.
349 * This way we <i>know</i> that the Array returned is of
350 * exactly the correct length.
352 * @return this collection as an Array
354 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement(
356 jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
357 return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList.toArray(array);
361 * Method getAnnotationElementCount.
363 * @return the size of this collection
365 public int getAnnotationElementCount(
367 return this._annotationElementList.size();
371 * Returns the value of field 'autoCalculated'. The field
372 * 'autoCalculated' has the following description: is an
373 * autocalculated annotation row
375 * @return the value of field 'AutoCalculated'.
377 public boolean getAutoCalculated(
379 return this._autoCalculated;
383 * Returns the value of field 'centreColLabels'.
385 * @return the value of field 'CentreColLabels'.
387 public boolean getCentreColLabels(
389 return this._centreColLabels;
393 * Returns the value of field 'description'.
395 * @return the value of field 'Description'.
397 public java.lang.String getDescription(
399 return this._description;
403 * Returns the value of field 'graph'.
405 * @return the value of field 'Graph'.
407 public boolean getGraph(
413 * Returns the value of field 'graphColour'.
415 * @return the value of field 'GraphColour'.
417 public int getGraphColour(
419 return this._graphColour;
423 * Returns the value of field 'graphGroup'.
425 * @return the value of field 'GraphGroup'.
427 public int getGraphGroup(
429 return this._graphGroup;
433 * Returns the value of field 'graphHeight'. The field
434 * 'graphHeight' has the following description: height in
435 * pixels for the graph if this is a graph-type annotation.
437 * @return the value of field 'GraphHeight'.
439 public int getGraphHeight(
441 return this._graphHeight;
445 * Returns the value of field 'graphType'.
447 * @return the value of field 'GraphType'.
449 public int getGraphType(
451 return this._graphType;
455 * Returns the value of field 'groupRef'.
457 * @return the value of field 'GroupRef'.
459 public java.lang.String getGroupRef(
461 return this._groupRef;
465 * Returns the value of field 'id'.
467 * @return the value of field 'Id'.
469 public java.lang.String getId(
475 * Returns the value of field 'label'.
477 * @return the value of field 'Label'.
479 public java.lang.String getLabel(
485 * Returns the value of field 'scaleColLabels'.
487 * @return the value of field 'ScaleColLabels'.
489 public boolean getScaleColLabels(
491 return this._scaleColLabels;
495 * Returns the value of field 'score'.
497 * @return the value of field 'Score'.
499 public double getScore(
505 * Returns the value of field 'scoreOnly'.
507 * @return the value of field 'ScoreOnly'.
509 public boolean getScoreOnly(
511 return this._scoreOnly;
515 * Returns the value of field 'sequenceRef'.
517 * @return the value of field 'SequenceRef'.
519 public java.lang.String getSequenceRef(
521 return this._sequenceRef;
525 * Returns the value of field 'showAllColLabels'.
527 * @return the value of field 'ShowAllColLabels'.
529 public boolean getShowAllColLabels(
531 return this._showAllColLabels;
535 * Returns the value of field 'thresholdLine'.
537 * @return the value of field 'ThresholdLine'.
539 public jalview.schemabinding.version2.ThresholdLine getThresholdLine(
541 return this._thresholdLine;
545 * Returns the value of field 'visible'.
547 * @return the value of field 'Visible'.
549 public boolean getVisible(
551 return this._visible;
555 * Method hasAutoCalculated.
557 * @return true if at least one AutoCalculated has been added
559 public boolean hasAutoCalculated(
561 return this._has_autoCalculated;
565 * Method hasCentreColLabels.
567 * @return true if at least one CentreColLabels has been added
569 public boolean hasCentreColLabels(
571 return this._has_centreColLabels;
577 * @return true if at least one Graph has been added
579 public boolean hasGraph(
581 return this._has_graph;
585 * Method hasGraphColour.
587 * @return true if at least one GraphColour has been added
589 public boolean hasGraphColour(
591 return this._has_graphColour;
595 * Method hasGraphGroup.
597 * @return true if at least one GraphGroup has been added
599 public boolean hasGraphGroup(
601 return this._has_graphGroup;
605 * Method hasGraphHeight.
607 * @return true if at least one GraphHeight has been added
609 public boolean hasGraphHeight(
611 return this._has_graphHeight;
615 * Method hasGraphType.
617 * @return true if at least one GraphType has been added
619 public boolean hasGraphType(
621 return this._has_graphType;
625 * Method hasScaleColLabels.
627 * @return true if at least one ScaleColLabels has been added
629 public boolean hasScaleColLabels(
631 return this._has_scaleColLabels;
637 * @return true if at least one Score has been added
639 public boolean hasScore(
641 return this._has_score;
645 * Method hasScoreOnly.
647 * @return true if at least one ScoreOnly has been added
649 public boolean hasScoreOnly(
651 return this._has_scoreOnly;
655 * Method hasShowAllColLabels.
657 * @return true if at least one ShowAllColLabels has been added
659 public boolean hasShowAllColLabels(
661 return this._has_showAllColLabels;
667 * @return true if at least one Visible has been added
669 public boolean hasVisible(
671 return this._has_visible;
675 * Returns the value of field 'autoCalculated'. The field
676 * 'autoCalculated' has the following description: is an
677 * autocalculated annotation row
679 * @return the value of field 'AutoCalculated'.
681 public boolean isAutoCalculated(
683 return this._autoCalculated;
687 * Returns the value of field 'centreColLabels'.
689 * @return the value of field 'CentreColLabels'.
691 public boolean isCentreColLabels(
693 return this._centreColLabels;
697 * Returns the value of field 'graph'.
699 * @return the value of field 'Graph'.
701 public boolean isGraph(
707 * Returns the value of field 'scaleColLabels'.
709 * @return the value of field 'ScaleColLabels'.
711 public boolean isScaleColLabels(
713 return this._scaleColLabels;
717 * Returns the value of field 'scoreOnly'.
719 * @return the value of field 'ScoreOnly'.
721 public boolean isScoreOnly(
723 return this._scoreOnly;
727 * Returns the value of field 'showAllColLabels'.
729 * @return the value of field 'ShowAllColLabels'.
731 public boolean isShowAllColLabels(
733 return this._showAllColLabels;
739 * @return true if this object is valid according to the schema
741 public boolean isValid(
745 } catch (org.exolab.castor.xml.ValidationException vex) {
752 * Returns the value of field 'visible'.
754 * @return the value of field 'Visible'.
756 public boolean isVisible(
758 return this._visible;
765 * @throws org.exolab.castor.xml.MarshalException if object is
766 * null or if any SAXException is thrown during marshaling
767 * @throws org.exolab.castor.xml.ValidationException if this
768 * object is an invalid instance according to the schema
771 final java.io.Writer out)
772 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
773 Marshaller.marshal(this, out);
780 * @throws java.io.IOException if an IOException occurs during
782 * @throws org.exolab.castor.xml.ValidationException if this
783 * object is an invalid instance according to the schema
784 * @throws org.exolab.castor.xml.MarshalException if object is
785 * null or if any SAXException is thrown during marshaling
788 final org.xml.sax.ContentHandler handler)
789 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
790 Marshaller.marshal(this, handler);
795 public void removeAllAnnotationElement(
797 this._annotationElementList.clear();
801 * Method removeAnnotationElement.
803 * @param vAnnotationElement
804 * @return true if the object was removed from the collection.
806 public boolean removeAnnotationElement(
807 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) {
808 boolean removed = _annotationElementList.remove(vAnnotationElement);
813 * Method removeAnnotationElementAt.
816 * @return the element removed from the collection
818 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
820 java.lang.Object obj = this._annotationElementList.remove(index);
821 return (jalview.schemabinding.version2.AnnotationElement) obj;
828 * @param vAnnotationElement
829 * @throws java.lang.IndexOutOfBoundsException if the index
830 * given is outside the bounds of the collection
832 public void setAnnotationElement(
834 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
835 throws java.lang.IndexOutOfBoundsException {
836 // check bounds for index
837 if (index < 0 || index >= this._annotationElementList.size()) {
838 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
841 this._annotationElementList.set(index, vAnnotationElement);
847 * @param vAnnotationElementArray
849 public void setAnnotationElement(
850 final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray) {
852 _annotationElementList.clear();
854 for (int i = 0; i < vAnnotationElementArray.length; i++) {
855 this._annotationElementList.add(vAnnotationElementArray[i]);
860 * Sets the value of field 'autoCalculated'. The field
861 * 'autoCalculated' has the following description: is an
862 * autocalculated annotation row
864 * @param autoCalculated the value of field 'autoCalculated'.
866 public void setAutoCalculated(
867 final boolean autoCalculated) {
868 this._autoCalculated = autoCalculated;
869 this._has_autoCalculated = true;
873 * Sets the value of field 'centreColLabels'.
875 * @param centreColLabels the value of field 'centreColLabels'.
877 public void setCentreColLabels(
878 final boolean centreColLabels) {
879 this._centreColLabels = centreColLabels;
880 this._has_centreColLabels = true;
884 * Sets the value of field 'description'.
886 * @param description the value of field 'description'.
888 public void setDescription(
889 final java.lang.String description) {
890 this._description = description;
894 * Sets the value of field 'graph'.
896 * @param graph the value of field 'graph'.
898 public void setGraph(
899 final boolean graph) {
901 this._has_graph = true;
905 * Sets the value of field 'graphColour'.
907 * @param graphColour the value of field 'graphColour'.
909 public void setGraphColour(
910 final int graphColour) {
911 this._graphColour = graphColour;
912 this._has_graphColour = true;
916 * Sets the value of field 'graphGroup'.
918 * @param graphGroup the value of field 'graphGroup'.
920 public void setGraphGroup(
921 final int graphGroup) {
922 this._graphGroup = graphGroup;
923 this._has_graphGroup = true;
927 * Sets the value of field 'graphHeight'. The field
928 * 'graphHeight' has the following description: height in
929 * pixels for the graph if this is a graph-type annotation.
931 * @param graphHeight the value of field 'graphHeight'.
933 public void setGraphHeight(
934 final int graphHeight) {
935 this._graphHeight = graphHeight;
936 this._has_graphHeight = true;
940 * Sets the value of field 'graphType'.
942 * @param graphType the value of field 'graphType'.
944 public void setGraphType(
945 final int graphType) {
946 this._graphType = graphType;
947 this._has_graphType = true;
951 * Sets the value of field 'groupRef'.
953 * @param groupRef the value of field 'groupRef'.
955 public void setGroupRef(
956 final java.lang.String groupRef) {
957 this._groupRef = groupRef;
961 * Sets the value of field 'id'.
963 * @param id the value of field 'id'.
966 final java.lang.String id) {
971 * Sets the value of field 'label'.
973 * @param label the value of field 'label'.
975 public void setLabel(
976 final java.lang.String label) {
981 * Sets the value of field 'scaleColLabels'.
983 * @param scaleColLabels the value of field 'scaleColLabels'.
985 public void setScaleColLabels(
986 final boolean scaleColLabels) {
987 this._scaleColLabels = scaleColLabels;
988 this._has_scaleColLabels = true;
992 * Sets the value of field 'score'.
994 * @param score the value of field 'score'.
996 public void setScore(
997 final double score) {
999 this._has_score = true;
1003 * Sets the value of field 'scoreOnly'.
1005 * @param scoreOnly the value of field 'scoreOnly'.
1007 public void setScoreOnly(
1008 final boolean scoreOnly) {
1009 this._scoreOnly = scoreOnly;
1010 this._has_scoreOnly = true;
1014 * Sets the value of field 'sequenceRef'.
1016 * @param sequenceRef the value of field 'sequenceRef'.
1018 public void setSequenceRef(
1019 final java.lang.String sequenceRef) {
1020 this._sequenceRef = sequenceRef;
1024 * Sets the value of field 'showAllColLabels'.
1026 * @param showAllColLabels the value of field 'showAllColLabels'
1028 public void setShowAllColLabels(
1029 final boolean showAllColLabels) {
1030 this._showAllColLabels = showAllColLabels;
1031 this._has_showAllColLabels = true;
1035 * Sets the value of field 'thresholdLine'.
1037 * @param thresholdLine the value of field 'thresholdLine'.
1039 public void setThresholdLine(
1040 final jalview.schemabinding.version2.ThresholdLine thresholdLine) {
1041 this._thresholdLine = thresholdLine;
1045 * Sets the value of field 'visible'.
1047 * @param visible the value of field 'visible'.
1049 public void setVisible(
1050 final boolean visible) {
1051 this._visible = visible;
1052 this._has_visible = true;
1059 * @throws org.exolab.castor.xml.MarshalException if object is
1060 * null or if any SAXException is thrown during marshaling
1061 * @throws org.exolab.castor.xml.ValidationException if this
1062 * object is an invalid instance according to the schema
1063 * @return the unmarshaled
1064 * jalview.schemabinding.version2.Annotation
1066 public static jalview.schemabinding.version2.Annotation unmarshal(
1067 final java.io.Reader reader)
1068 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1069 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
1075 * @throws org.exolab.castor.xml.ValidationException if this
1076 * object is an invalid instance according to the schema
1078 public void validate(
1080 throws org.exolab.castor.xml.ValidationException {
1081 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1082 validator.validate(this);