autogenerated java classes for current schema
[vamsas.git] / src / org / vamsas / objects / core / AlignmentAnnotation.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.Marshaller;
20 import org.exolab.castor.xml.Unmarshaller;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.ContentHandler;
23
24 /**
25  * This is annotation over the
26  *  coordinate frame defined by all
27  *  the columns in the alignment.
28  *  
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class AlignmentAnnotation extends org.vamsas.objects.core.RangeAnnotation 
33 implements java.io.Serializable
34 {
35
36
37       //--------------------------/
38      //- Class/Member Variables -/
39     //--------------------------/
40
41     /**
42      * TODO: decide if
43      *  this flag is
44      *  redundant - when
45      *  true it would
46      *  suggest that the
47      *  annotationElement
48      *  values together
49      *  form a graph
50      *  
51      */
52     private boolean _graph;
53
54     /**
55      * keeps track of state for field: _graph
56      */
57     private boolean _has_graph;
58
59     /**
60      * Field _provenance
61      */
62     private org.vamsas.objects.core.Provenance _provenance;
63
64
65       //----------------/
66      //- Constructors -/
67     //----------------/
68
69     public AlignmentAnnotation() 
70      {
71         super();
72     } //-- org.vamsas.objects.core.AlignmentAnnotation()
73
74
75       //-----------/
76      //- Methods -/
77     //-----------/
78
79     /**
80      * Method deleteGraph
81      * 
82      */
83     public void deleteGraph()
84     {
85         this._has_graph= false;
86     } //-- void deleteGraph() 
87
88     /**
89      * Note: hashCode() has not been overriden
90      * 
91      * @param obj
92      * @return boolean
93      */
94     public boolean equals(java.lang.Object obj)
95     {
96         if ( this == obj )
97             return true;
98         
99         if (super.equals(obj)==false)
100             return false;
101         
102         if (obj instanceof AlignmentAnnotation) {
103         
104             AlignmentAnnotation temp = (AlignmentAnnotation)obj;
105             if (this._graph != temp._graph)
106                 return false;
107             if (this._has_graph != temp._has_graph)
108                 return false;
109             if (this._provenance != null) {
110                 if (temp._provenance == null) return false;
111                 else if (!(this._provenance.equals(temp._provenance))) 
112                     return false;
113             }
114             else if (temp._provenance != null)
115                 return false;
116             return true;
117         }
118         return false;
119     } //-- boolean equals(java.lang.Object) 
120
121     /**
122      * Returns the value of field 'graph'. The field 'graph' has
123      * the following description: TODO: decide if
124      *  this flag is
125      *  redundant - when
126      *  true it would
127      *  suggest that the
128      *  annotationElement
129      *  values together
130      *  form a graph
131      *  
132      * 
133      * @return boolean
134      * @return the value of field 'graph'.
135      */
136     public boolean getGraph()
137     {
138         return this._graph;
139     } //-- boolean getGraph() 
140
141     /**
142      * Returns the value of field 'provenance'.
143      * 
144      * @return Provenance
145      * @return the value of field 'provenance'.
146      */
147     public org.vamsas.objects.core.Provenance getProvenance()
148     {
149         return this._provenance;
150     } //-- org.vamsas.objects.core.Provenance getProvenance() 
151
152     /**
153      * Method hasGraph
154      * 
155      * 
156      * 
157      * @return boolean
158      */
159     public boolean hasGraph()
160     {
161         return this._has_graph;
162     } //-- boolean hasGraph() 
163
164     /**
165      * Method isValid
166      * 
167      * 
168      * 
169      * @return boolean
170      */
171     public boolean isValid()
172     {
173         try {
174             validate();
175         }
176         catch (org.exolab.castor.xml.ValidationException vex) {
177             return false;
178         }
179         return true;
180     } //-- boolean isValid() 
181
182     /**
183      * Method marshal
184      * 
185      * 
186      * 
187      * @param out
188      */
189     public void marshal(java.io.Writer out)
190         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
191     {
192         
193         Marshaller.marshal(this, out);
194     } //-- void marshal(java.io.Writer) 
195
196     /**
197      * Method marshal
198      * 
199      * 
200      * 
201      * @param handler
202      */
203     public void marshal(org.xml.sax.ContentHandler handler)
204         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
205     {
206         
207         Marshaller.marshal(this, handler);
208     } //-- void marshal(org.xml.sax.ContentHandler) 
209
210     /**
211      * Sets the value of field 'graph'. The field 'graph' has the
212      * following description: TODO: decide if
213      *  this flag is
214      *  redundant - when
215      *  true it would
216      *  suggest that the
217      *  annotationElement
218      *  values together
219      *  form a graph
220      *  
221      * 
222      * @param graph the value of field 'graph'.
223      */
224     public void setGraph(boolean graph)
225     {
226         this._graph = graph;
227         this._has_graph = true;
228     } //-- void setGraph(boolean) 
229
230     /**
231      * Sets the value of field 'provenance'.
232      * 
233      * @param provenance the value of field 'provenance'.
234      */
235     public void setProvenance(org.vamsas.objects.core.Provenance provenance)
236     {
237         this._provenance = provenance;
238     } //-- void setProvenance(org.vamsas.objects.core.Provenance) 
239
240     /**
241      * Method unmarshal
242      * 
243      * 
244      * 
245      * @param reader
246      * @return RangeType
247      */
248     public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader)
249         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
250     {
251         return (org.vamsas.objects.core.AlignmentAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentAnnotation.class, reader);
252     } //-- org.vamsas.objects.core.RangeType unmarshal(java.io.Reader) 
253
254     /**
255      * Method validate
256      * 
257      */
258     public void validate()
259         throws org.exolab.castor.xml.ValidationException
260     {
261         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
262         validator.validate(this);
263     } //-- void validate() 
264
265 }