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