2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
20 * @version $Revision$ $Date$
\r
22 public class Annotation implements java.io.Serializable {
\r
25 //--------------------------/
\r
26 //- Class/Member Variables -/
\r
27 //--------------------------/
\r
32 private boolean _graph;
\r
35 * keeps track of state for field: _graph
\r
37 private boolean _has_graph;
\r
42 private int _graphType;
\r
45 * keeps track of state for field: _graphType
\r
47 private boolean _has_graphType;
\r
50 * Field _sequenceRef.
\r
52 private java.lang.String _sequenceRef;
\r
55 * Field _graphColour.
\r
57 private int _graphColour;
\r
60 * keeps track of state for field: _graphColour
\r
62 private boolean _has_graphColour;
\r
65 * Field _graphGroup.
\r
67 private int _graphGroup;
\r
70 * keeps track of state for field: _graphGroup
\r
72 private boolean _has_graphGroup;
\r
77 private java.lang.String _id;
\r
82 private boolean _scoreOnly = false;
\r
85 * keeps track of state for field: _scoreOnly
\r
87 private boolean _has_scoreOnly;
\r
92 private double _score;
\r
95 * keeps track of state for field: _score
\r
97 private boolean _has_score;
\r
102 private boolean _visible;
\r
105 * keeps track of state for field: _visible
\r
107 private boolean _has_visible;
\r
110 * Field _annotationElementList.
\r
112 private java.util.Vector _annotationElementList;
\r
117 private java.lang.String _label;
\r
120 * Field _description.
\r
122 private java.lang.String _description;
\r
125 * Field _thresholdLine.
\r
127 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
\r
130 //----------------/
\r
131 //- Constructors -/
\r
132 //----------------/
\r
134 public Annotation() {
\r
136 this._annotationElementList = new java.util.Vector();
\r
147 * @param vAnnotationElement
\r
148 * @throws java.lang.IndexOutOfBoundsException if the index
\r
149 * given is outside the bounds of the collection
\r
151 public void addAnnotationElement(
\r
152 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
153 throws java.lang.IndexOutOfBoundsException {
\r
154 this._annotationElementList.addElement(vAnnotationElement);
\r
161 * @param vAnnotationElement
\r
162 * @throws java.lang.IndexOutOfBoundsException if the index
\r
163 * given is outside the bounds of the collection
\r
165 public void addAnnotationElement(
\r
167 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
168 throws java.lang.IndexOutOfBoundsException {
\r
169 this._annotationElementList.add(index, vAnnotationElement);
\r
174 public void deleteGraph(
\r
176 this._has_graph= false;
\r
181 public void deleteGraphColour(
\r
183 this._has_graphColour= false;
\r
188 public void deleteGraphGroup(
\r
190 this._has_graphGroup= false;
\r
195 public void deleteGraphType(
\r
197 this._has_graphType= false;
\r
202 public void deleteScore(
\r
204 this._has_score= false;
\r
209 public void deleteScoreOnly(
\r
211 this._has_scoreOnly= false;
\r
216 public void deleteVisible(
\r
218 this._has_visible= false;
\r
222 * Method enumerateAnnotationElement.
\r
224 * @return an Enumeration over all
\r
225 * jalview.schemabinding.version2.AnnotationElement elements
\r
227 public java.util.Enumeration enumerateAnnotationElement(
\r
229 return this._annotationElementList.elements();
\r
233 * Method getAnnotationElement.
\r
236 * @throws java.lang.IndexOutOfBoundsException if the index
\r
237 * given is outside the bounds of the collection
\r
238 * @return the value of the
\r
239 * jalview.schemabinding.version2.AnnotationElement at the
\r
242 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(
\r
244 throws java.lang.IndexOutOfBoundsException {
\r
245 // check bounds for index
\r
246 if (index < 0 || index >= this._annotationElementList.size()) {
\r
247 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
\r
250 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.get(index);
\r
254 * Method getAnnotationElement.Returns the contents of the
\r
255 * collection in an Array. <p>Note: Just in case the
\r
256 * collection contents are changing in another thread, we pass
\r
257 * a 0-length Array of the correct type into the API call.
\r
258 * This way we <i>know</i> that the Array returned is of
\r
259 * exactly the correct length.
\r
261 * @return this collection as an Array
\r
263 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement(
\r
265 jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0];
\r
266 return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList.toArray(array);
\r
270 * Method getAnnotationElementCount.
\r
272 * @return the size of this collection
\r
274 public int getAnnotationElementCount(
\r
276 return this._annotationElementList.size();
\r
280 * Returns the value of field 'description'.
\r
282 * @return the value of field 'Description'.
\r
284 public java.lang.String getDescription(
\r
286 return this._description;
\r
290 * Returns the value of field 'graph'.
\r
292 * @return the value of field 'Graph'.
\r
294 public boolean getGraph(
\r
296 return this._graph;
\r
300 * Returns the value of field 'graphColour'.
\r
302 * @return the value of field 'GraphColour'.
\r
304 public int getGraphColour(
\r
306 return this._graphColour;
\r
310 * Returns the value of field 'graphGroup'.
\r
312 * @return the value of field 'GraphGroup'.
\r
314 public int getGraphGroup(
\r
316 return this._graphGroup;
\r
320 * Returns the value of field 'graphType'.
\r
322 * @return the value of field 'GraphType'.
\r
324 public int getGraphType(
\r
326 return this._graphType;
\r
330 * Returns the value of field 'id'.
\r
332 * @return the value of field 'Id'.
\r
334 public java.lang.String getId(
\r
340 * Returns the value of field 'label'.
\r
342 * @return the value of field 'Label'.
\r
344 public java.lang.String getLabel(
\r
346 return this._label;
\r
350 * Returns the value of field 'score'.
\r
352 * @return the value of field 'Score'.
\r
354 public double getScore(
\r
356 return this._score;
\r
360 * Returns the value of field 'scoreOnly'.
\r
362 * @return the value of field 'ScoreOnly'.
\r
364 public boolean getScoreOnly(
\r
366 return this._scoreOnly;
\r
370 * Returns the value of field 'sequenceRef'.
\r
372 * @return the value of field 'SequenceRef'.
\r
374 public java.lang.String getSequenceRef(
\r
376 return this._sequenceRef;
\r
380 * Returns the value of field 'thresholdLine'.
\r
382 * @return the value of field 'ThresholdLine'.
\r
384 public jalview.schemabinding.version2.ThresholdLine getThresholdLine(
\r
386 return this._thresholdLine;
\r
390 * Returns the value of field 'visible'.
\r
392 * @return the value of field 'Visible'.
\r
394 public boolean getVisible(
\r
396 return this._visible;
\r
402 * @return true if at least one Graph has been added
\r
404 public boolean hasGraph(
\r
406 return this._has_graph;
\r
410 * Method hasGraphColour.
\r
412 * @return true if at least one GraphColour has been added
\r
414 public boolean hasGraphColour(
\r
416 return this._has_graphColour;
\r
420 * Method hasGraphGroup.
\r
422 * @return true if at least one GraphGroup has been added
\r
424 public boolean hasGraphGroup(
\r
426 return this._has_graphGroup;
\r
430 * Method hasGraphType.
\r
432 * @return true if at least one GraphType has been added
\r
434 public boolean hasGraphType(
\r
436 return this._has_graphType;
\r
442 * @return true if at least one Score has been added
\r
444 public boolean hasScore(
\r
446 return this._has_score;
\r
450 * Method hasScoreOnly.
\r
452 * @return true if at least one ScoreOnly has been added
\r
454 public boolean hasScoreOnly(
\r
456 return this._has_scoreOnly;
\r
460 * Method hasVisible.
\r
462 * @return true if at least one Visible has been added
\r
464 public boolean hasVisible(
\r
466 return this._has_visible;
\r
470 * Returns the value of field 'graph'.
\r
472 * @return the value of field 'Graph'.
\r
474 public boolean isGraph(
\r
476 return this._graph;
\r
480 * Returns the value of field 'scoreOnly'.
\r
482 * @return the value of field 'ScoreOnly'.
\r
484 public boolean isScoreOnly(
\r
486 return this._scoreOnly;
\r
492 * @return true if this object is valid according to the schema
\r
494 public boolean isValid(
\r
498 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
505 * Returns the value of field 'visible'.
\r
507 * @return the value of field 'Visible'.
\r
509 public boolean isVisible(
\r
511 return this._visible;
\r
518 * @throws org.exolab.castor.xml.MarshalException if object is
\r
519 * null or if any SAXException is thrown during marshaling
\r
520 * @throws org.exolab.castor.xml.ValidationException if this
\r
521 * object is an invalid instance according to the schema
\r
523 public void marshal(
\r
524 final java.io.Writer out)
\r
525 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
526 Marshaller.marshal(this, out);
\r
533 * @throws java.io.IOException if an IOException occurs during
\r
535 * @throws org.exolab.castor.xml.ValidationException if this
\r
536 * object is an invalid instance according to the schema
\r
537 * @throws org.exolab.castor.xml.MarshalException if object is
\r
538 * null or if any SAXException is thrown during marshaling
\r
540 public void marshal(
\r
541 final org.xml.sax.ContentHandler handler)
\r
542 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
543 Marshaller.marshal(this, handler);
\r
548 public void removeAllAnnotationElement(
\r
550 this._annotationElementList.clear();
\r
554 * Method removeAnnotationElement.
\r
556 * @param vAnnotationElement
\r
557 * @return true if the object was removed from the collection.
\r
559 public boolean removeAnnotationElement(
\r
560 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) {
\r
561 boolean removed = _annotationElementList.remove(vAnnotationElement);
\r
566 * Method removeAnnotationElementAt.
\r
569 * @return the element removed from the collection
\r
571 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt(
\r
573 java.lang.Object obj = this._annotationElementList.remove(index);
\r
574 return (jalview.schemabinding.version2.AnnotationElement) obj;
\r
581 * @param vAnnotationElement
\r
582 * @throws java.lang.IndexOutOfBoundsException if the index
\r
583 * given is outside the bounds of the collection
\r
585 public void setAnnotationElement(
\r
587 final jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
588 throws java.lang.IndexOutOfBoundsException {
\r
589 // check bounds for index
\r
590 if (index < 0 || index >= this._annotationElementList.size()) {
\r
591 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
\r
594 this._annotationElementList.set(index, vAnnotationElement);
\r
600 * @param vAnnotationElementArray
\r
602 public void setAnnotationElement(
\r
603 final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray) {
\r
605 _annotationElementList.clear();
\r
607 for (int i = 0; i < vAnnotationElementArray.length; i++) {
\r
608 this._annotationElementList.add(vAnnotationElementArray[i]);
\r
613 * Sets the value of field 'description'.
\r
615 * @param description the value of field 'description'.
\r
617 public void setDescription(
\r
618 final java.lang.String description) {
\r
619 this._description = description;
\r
623 * Sets the value of field 'graph'.
\r
625 * @param graph the value of field 'graph'.
\r
627 public void setGraph(
\r
628 final boolean graph) {
\r
629 this._graph = graph;
\r
630 this._has_graph = true;
\r
634 * Sets the value of field 'graphColour'.
\r
636 * @param graphColour the value of field 'graphColour'.
\r
638 public void setGraphColour(
\r
639 final int graphColour) {
\r
640 this._graphColour = graphColour;
\r
641 this._has_graphColour = true;
\r
645 * Sets the value of field 'graphGroup'.
\r
647 * @param graphGroup the value of field 'graphGroup'.
\r
649 public void setGraphGroup(
\r
650 final int graphGroup) {
\r
651 this._graphGroup = graphGroup;
\r
652 this._has_graphGroup = true;
\r
656 * Sets the value of field 'graphType'.
\r
658 * @param graphType the value of field 'graphType'.
\r
660 public void setGraphType(
\r
661 final int graphType) {
\r
662 this._graphType = graphType;
\r
663 this._has_graphType = true;
\r
667 * Sets the value of field 'id'.
\r
669 * @param id the value of field 'id'.
\r
672 final java.lang.String id) {
\r
677 * Sets the value of field 'label'.
\r
679 * @param label the value of field 'label'.
\r
681 public void setLabel(
\r
682 final java.lang.String label) {
\r
683 this._label = label;
\r
687 * Sets the value of field 'score'.
\r
689 * @param score the value of field 'score'.
\r
691 public void setScore(
\r
692 final double score) {
\r
693 this._score = score;
\r
694 this._has_score = true;
\r
698 * Sets the value of field 'scoreOnly'.
\r
700 * @param scoreOnly the value of field 'scoreOnly'.
\r
702 public void setScoreOnly(
\r
703 final boolean scoreOnly) {
\r
704 this._scoreOnly = scoreOnly;
\r
705 this._has_scoreOnly = true;
\r
709 * Sets the value of field 'sequenceRef'.
\r
711 * @param sequenceRef the value of field 'sequenceRef'.
\r
713 public void setSequenceRef(
\r
714 final java.lang.String sequenceRef) {
\r
715 this._sequenceRef = sequenceRef;
\r
719 * Sets the value of field 'thresholdLine'.
\r
721 * @param thresholdLine the value of field 'thresholdLine'.
\r
723 public void setThresholdLine(
\r
724 final jalview.schemabinding.version2.ThresholdLine thresholdLine) {
\r
725 this._thresholdLine = thresholdLine;
\r
729 * Sets the value of field 'visible'.
\r
731 * @param visible the value of field 'visible'.
\r
733 public void setVisible(
\r
734 final boolean visible) {
\r
735 this._visible = visible;
\r
736 this._has_visible = true;
\r
740 * Method unmarshal.
\r
743 * @throws org.exolab.castor.xml.MarshalException if object is
\r
744 * null or if any SAXException is thrown during marshaling
\r
745 * @throws org.exolab.castor.xml.ValidationException if this
\r
746 * object is an invalid instance according to the schema
\r
747 * @return the unmarshaled
\r
748 * jalview.schemabinding.version2.Annotation
\r
750 public static jalview.schemabinding.version2.Annotation unmarshal(
\r
751 final java.io.Reader reader)
\r
752 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
753 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
\r
759 * @throws org.exolab.castor.xml.ValidationException if this
\r
760 * object is an invalid instance according to the schema
\r
762 public void validate(
\r
764 throws org.exolab.castor.xml.ValidationException {
\r
765 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
766 validator.validate(this);
\r