2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import java.io.IOException;
\r
15 import java.io.Reader;
\r
16 import java.io.Serializable;
\r
17 import java.io.Writer;
\r
18 import java.util.Enumeration;
\r
19 import java.util.Vector;
\r
20 import org.exolab.castor.xml.MarshalException;
\r
21 import org.exolab.castor.xml.Marshaller;
\r
22 import org.exolab.castor.xml.Unmarshaller;
\r
23 import org.exolab.castor.xml.ValidationException;
\r
24 import org.xml.sax.ContentHandler;
\r
29 * @version $Revision$ $Date$
\r
31 public class Annotation implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
41 private boolean _graph;
\r
44 * keeps track of state for field: _graph
\r
46 private boolean _has_graph;
\r
51 private int _graphType;
\r
54 * keeps track of state for field: _graphType
\r
56 private boolean _has_graphType;
\r
59 * Field _sequenceRef
\r
61 private java.lang.String _sequenceRef;
\r
64 * Field _graphColour
\r
66 private int _graphColour;
\r
69 * keeps track of state for field: _graphColour
\r
71 private boolean _has_graphColour;
\r
76 private int _graphGroup;
\r
79 * keeps track of state for field: _graphGroup
\r
81 private boolean _has_graphGroup;
\r
86 private java.lang.String _id;
\r
91 private boolean _scoreOnly = false;
\r
94 * keeps track of state for field: _scoreOnly
\r
96 private boolean _has_scoreOnly;
\r
101 private double _score;
\r
104 * keeps track of state for field: _score
\r
106 private boolean _has_score;
\r
111 private boolean _visible;
\r
114 * keeps track of state for field: _visible
\r
116 private boolean _has_visible;
\r
119 * Field _annotationElementList
\r
121 private java.util.Vector _annotationElementList;
\r
126 private java.lang.String _label;
\r
129 * Field _description
\r
131 private java.lang.String _description;
\r
134 * Field _thresholdLine
\r
136 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
\r
139 //----------------/
\r
140 //- Constructors -/
\r
141 //----------------/
\r
143 public Annotation() {
\r
145 _annotationElementList = new Vector();
\r
146 } //-- jalview.schemabinding.version2.Annotation()
\r
154 * Method addAnnotationElement
\r
158 * @param vAnnotationElement
\r
160 public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
161 throws java.lang.IndexOutOfBoundsException
\r
163 _annotationElementList.addElement(vAnnotationElement);
\r
164 } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement)
\r
167 * Method addAnnotationElement
\r
172 * @param vAnnotationElement
\r
174 public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
175 throws java.lang.IndexOutOfBoundsException
\r
177 _annotationElementList.insertElementAt(vAnnotationElement, index);
\r
178 } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement)
\r
181 * Method deleteGraph
\r
184 public void deleteGraph()
\r
186 this._has_graph= false;
\r
187 } //-- void deleteGraph()
\r
190 * Method deleteGraphColour
\r
193 public void deleteGraphColour()
\r
195 this._has_graphColour= false;
\r
196 } //-- void deleteGraphColour()
\r
199 * Method deleteGraphGroup
\r
202 public void deleteGraphGroup()
\r
204 this._has_graphGroup= false;
\r
205 } //-- void deleteGraphGroup()
\r
208 * Method deleteGraphType
\r
211 public void deleteGraphType()
\r
213 this._has_graphType= false;
\r
214 } //-- void deleteGraphType()
\r
217 * Method deleteScore
\r
220 public void deleteScore()
\r
222 this._has_score= false;
\r
223 } //-- void deleteScore()
\r
226 * Method deleteScoreOnly
\r
229 public void deleteScoreOnly()
\r
231 this._has_scoreOnly= false;
\r
232 } //-- void deleteScoreOnly()
\r
235 * Method deleteVisible
\r
238 public void deleteVisible()
\r
240 this._has_visible= false;
\r
241 } //-- void deleteVisible()
\r
244 * Method enumerateAnnotationElement
\r
248 * @return Enumeration
\r
250 public java.util.Enumeration enumerateAnnotationElement()
\r
252 return _annotationElementList.elements();
\r
253 } //-- java.util.Enumeration enumerateAnnotationElement()
\r
256 * Method getAnnotationElement
\r
261 * @return AnnotationElement
\r
263 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)
\r
264 throws java.lang.IndexOutOfBoundsException
\r
266 //-- check bounds for index
\r
267 if ((index < 0) || (index > _annotationElementList.size())) {
\r
268 throw new IndexOutOfBoundsException();
\r
271 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);
\r
272 } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int)
\r
275 * Method getAnnotationElement
\r
279 * @return AnnotationElement
\r
281 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
\r
283 int size = _annotationElementList.size();
\r
284 jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];
\r
285 for (int index = 0; index < size; index++) {
\r
286 mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);
\r
289 } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
\r
292 * Method getAnnotationElementCount
\r
298 public int getAnnotationElementCount()
\r
300 return _annotationElementList.size();
\r
301 } //-- int getAnnotationElementCount()
\r
304 * Returns the value of field 'description'.
\r
307 * @return the value of field 'description'.
\r
309 public java.lang.String getDescription()
\r
311 return this._description;
\r
312 } //-- java.lang.String getDescription()
\r
315 * Returns the value of field 'graph'.
\r
318 * @return the value of field 'graph'.
\r
320 public boolean getGraph()
\r
322 return this._graph;
\r
323 } //-- boolean getGraph()
\r
326 * Returns the value of field 'graphColour'.
\r
329 * @return the value of field 'graphColour'.
\r
331 public int getGraphColour()
\r
333 return this._graphColour;
\r
334 } //-- int getGraphColour()
\r
337 * Returns the value of field 'graphGroup'.
\r
340 * @return the value of field 'graphGroup'.
\r
342 public int getGraphGroup()
\r
344 return this._graphGroup;
\r
345 } //-- int getGraphGroup()
\r
348 * Returns the value of field 'graphType'.
\r
351 * @return the value of field 'graphType'.
\r
353 public int getGraphType()
\r
355 return this._graphType;
\r
356 } //-- int getGraphType()
\r
359 * Returns the value of field 'id'.
\r
362 * @return the value of field 'id'.
\r
364 public java.lang.String getId()
\r
367 } //-- java.lang.String getId()
\r
370 * Returns the value of field 'label'.
\r
373 * @return the value of field 'label'.
\r
375 public java.lang.String getLabel()
\r
377 return this._label;
\r
378 } //-- java.lang.String getLabel()
\r
381 * Returns the value of field 'score'.
\r
384 * @return the value of field 'score'.
\r
386 public double getScore()
\r
388 return this._score;
\r
389 } //-- double getScore()
\r
392 * Returns the value of field 'scoreOnly'.
\r
395 * @return the value of field 'scoreOnly'.
\r
397 public boolean getScoreOnly()
\r
399 return this._scoreOnly;
\r
400 } //-- boolean getScoreOnly()
\r
403 * Returns the value of field 'sequenceRef'.
\r
406 * @return the value of field 'sequenceRef'.
\r
408 public java.lang.String getSequenceRef()
\r
410 return this._sequenceRef;
\r
411 } //-- java.lang.String getSequenceRef()
\r
414 * Returns the value of field 'thresholdLine'.
\r
416 * @return ThresholdLine
\r
417 * @return the value of field 'thresholdLine'.
\r
419 public jalview.schemabinding.version2.ThresholdLine getThresholdLine()
\r
421 return this._thresholdLine;
\r
422 } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine()
\r
425 * Returns the value of field 'visible'.
\r
428 * @return the value of field 'visible'.
\r
430 public boolean getVisible()
\r
432 return this._visible;
\r
433 } //-- boolean getVisible()
\r
442 public boolean hasGraph()
\r
444 return this._has_graph;
\r
445 } //-- boolean hasGraph()
\r
448 * Method hasGraphColour
\r
454 public boolean hasGraphColour()
\r
456 return this._has_graphColour;
\r
457 } //-- boolean hasGraphColour()
\r
460 * Method hasGraphGroup
\r
466 public boolean hasGraphGroup()
\r
468 return this._has_graphGroup;
\r
469 } //-- boolean hasGraphGroup()
\r
472 * Method hasGraphType
\r
478 public boolean hasGraphType()
\r
480 return this._has_graphType;
\r
481 } //-- boolean hasGraphType()
\r
490 public boolean hasScore()
\r
492 return this._has_score;
\r
493 } //-- boolean hasScore()
\r
496 * Method hasScoreOnly
\r
502 public boolean hasScoreOnly()
\r
504 return this._has_scoreOnly;
\r
505 } //-- boolean hasScoreOnly()
\r
508 * Method hasVisible
\r
514 public boolean hasVisible()
\r
516 return this._has_visible;
\r
517 } //-- boolean hasVisible()
\r
526 public boolean isValid()
\r
531 catch (org.exolab.castor.xml.ValidationException vex) {
\r
535 } //-- boolean isValid()
\r
544 public void marshal(java.io.Writer out)
\r
545 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
548 Marshaller.marshal(this, out);
\r
549 } //-- void marshal(java.io.Writer)
\r
558 public void marshal(org.xml.sax.ContentHandler handler)
\r
559 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
562 Marshaller.marshal(this, handler);
\r
563 } //-- void marshal(org.xml.sax.ContentHandler)
\r
566 * Method removeAllAnnotationElement
\r
569 public void removeAllAnnotationElement()
\r
571 _annotationElementList.removeAllElements();
\r
572 } //-- void removeAllAnnotationElement()
\r
575 * Method removeAnnotationElement
\r
580 * @return AnnotationElement
\r
582 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)
\r
584 java.lang.Object obj = _annotationElementList.elementAt(index);
\r
585 _annotationElementList.removeElementAt(index);
\r
586 return (jalview.schemabinding.version2.AnnotationElement) obj;
\r
587 } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int)
\r
590 * Method setAnnotationElement
\r
595 * @param vAnnotationElement
\r
597 public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
598 throws java.lang.IndexOutOfBoundsException
\r
600 //-- check bounds for index
\r
601 if ((index < 0) || (index > _annotationElementList.size())) {
\r
602 throw new IndexOutOfBoundsException();
\r
604 _annotationElementList.setElementAt(vAnnotationElement, index);
\r
605 } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement)
\r
608 * Method setAnnotationElement
\r
612 * @param annotationElementArray
\r
614 public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)
\r
617 _annotationElementList.removeAllElements();
\r
618 for (int i = 0; i < annotationElementArray.length; i++) {
\r
619 _annotationElementList.addElement(annotationElementArray[i]);
\r
621 } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement)
\r
624 * Sets the value of field 'description'.
\r
626 * @param description the value of field 'description'.
\r
628 public void setDescription(java.lang.String description)
\r
630 this._description = description;
\r
631 } //-- void setDescription(java.lang.String)
\r
634 * Sets the value of field 'graph'.
\r
636 * @param graph the value of field 'graph'.
\r
638 public void setGraph(boolean graph)
\r
640 this._graph = graph;
\r
641 this._has_graph = true;
\r
642 } //-- void setGraph(boolean)
\r
645 * Sets the value of field 'graphColour'.
\r
647 * @param graphColour the value of field 'graphColour'.
\r
649 public void setGraphColour(int graphColour)
\r
651 this._graphColour = graphColour;
\r
652 this._has_graphColour = true;
\r
653 } //-- void setGraphColour(int)
\r
656 * Sets the value of field 'graphGroup'.
\r
658 * @param graphGroup the value of field 'graphGroup'.
\r
660 public void setGraphGroup(int graphGroup)
\r
662 this._graphGroup = graphGroup;
\r
663 this._has_graphGroup = true;
\r
664 } //-- void setGraphGroup(int)
\r
667 * Sets the value of field 'graphType'.
\r
669 * @param graphType the value of field 'graphType'.
\r
671 public void setGraphType(int graphType)
\r
673 this._graphType = graphType;
\r
674 this._has_graphType = true;
\r
675 } //-- void setGraphType(int)
\r
678 * Sets the value of field 'id'.
\r
680 * @param id the value of field 'id'.
\r
682 public void setId(java.lang.String id)
\r
685 } //-- void setId(java.lang.String)
\r
688 * Sets the value of field 'label'.
\r
690 * @param label the value of field 'label'.
\r
692 public void setLabel(java.lang.String label)
\r
694 this._label = label;
\r
695 } //-- void setLabel(java.lang.String)
\r
698 * Sets the value of field 'score'.
\r
700 * @param score the value of field 'score'.
\r
702 public void setScore(double score)
\r
704 this._score = score;
\r
705 this._has_score = true;
\r
706 } //-- void setScore(double)
\r
709 * Sets the value of field 'scoreOnly'.
\r
711 * @param scoreOnly the value of field 'scoreOnly'.
\r
713 public void setScoreOnly(boolean scoreOnly)
\r
715 this._scoreOnly = scoreOnly;
\r
716 this._has_scoreOnly = true;
\r
717 } //-- void setScoreOnly(boolean)
\r
720 * Sets the value of field 'sequenceRef'.
\r
722 * @param sequenceRef the value of field 'sequenceRef'.
\r
724 public void setSequenceRef(java.lang.String sequenceRef)
\r
726 this._sequenceRef = sequenceRef;
\r
727 } //-- void setSequenceRef(java.lang.String)
\r
730 * Sets the value of field 'thresholdLine'.
\r
732 * @param thresholdLine the value of field 'thresholdLine'.
\r
734 public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)
\r
736 this._thresholdLine = thresholdLine;
\r
737 } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine)
\r
740 * Sets the value of field 'visible'.
\r
742 * @param visible the value of field 'visible'.
\r
744 public void setVisible(boolean visible)
\r
746 this._visible = visible;
\r
747 this._has_visible = true;
\r
748 } //-- void setVisible(boolean)
\r
758 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
759 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
761 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
\r
762 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
768 public void validate()
\r
769 throws org.exolab.castor.xml.ValidationException
\r
771 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
772 validator.validate(this);
\r
773 } //-- void validate()
\r