refactored org to uk
[vamsas.git] / src / org / vamsas / objects / core / Seg.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 org.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  * a region from start to end, with flag for inclusivity of\r
26  *  terminii \r
27  * \r
28  * @version $Revision$ $Date$\r
29  */\r
30 public class Seg extends uk.ac.vamsas.client.Vobject \r
31 implements java.io.Serializable\r
32 {\r
33 \r
34 \r
35       //--------------------------/\r
36      //- Class/Member Variables -/\r
37     //--------------------------/\r
38 \r
39     /**\r
40      * Field _start\r
41      */\r
42     private int _start;\r
43 \r
44     /**\r
45      * keeps track of state for field: _start\r
46      */\r
47     private boolean _has_start;\r
48 \r
49     /**\r
50      * Field _end\r
51      */\r
52     private int _end;\r
53 \r
54     /**\r
55      * keeps track of state for field: _end\r
56      */\r
57     private boolean _has_end;\r
58 \r
59     /**\r
60      * when false, a consecutive range like 'start=1, end=2'\r
61      *  means the region lying after position 1 and before position\r
62      * 2\r
63      *  \r
64      */\r
65     private boolean _inclusive;\r
66 \r
67     /**\r
68      * keeps track of state for field: _inclusive\r
69      */\r
70     private boolean _has_inclusive;\r
71 \r
72 \r
73       //----------------/\r
74      //- Constructors -/\r
75     //----------------/\r
76 \r
77     public Seg() \r
78      {\r
79         super();\r
80     } //-- org.vamsas.objects.core.Seg()\r
81 \r
82 \r
83       //-----------/\r
84      //- Methods -/\r
85     //-----------/\r
86 \r
87     /**\r
88      * Method deleteEnd\r
89      * \r
90      */\r
91     public void deleteEnd()\r
92     {\r
93         this._has_end= false;\r
94     } //-- void deleteEnd() \r
95 \r
96     /**\r
97      * Method deleteInclusive\r
98      * \r
99      */\r
100     public void deleteInclusive()\r
101     {\r
102         this._has_inclusive= false;\r
103     } //-- void deleteInclusive() \r
104 \r
105     /**\r
106      * Method deleteStart\r
107      * \r
108      */\r
109     public void deleteStart()\r
110     {\r
111         this._has_start= false;\r
112     } //-- void deleteStart() \r
113 \r
114     /**\r
115      * Note: hashCode() has not been overriden\r
116      * \r
117      * @param obj\r
118      * @return boolean\r
119      */\r
120     public boolean equals(java.lang.Object obj)\r
121     {\r
122         if ( this == obj )\r
123             return true;\r
124         \r
125         if (super.equals(obj)==false)\r
126             return false;\r
127         \r
128         if (obj instanceof Seg) {\r
129         \r
130             Seg temp = (Seg)obj;\r
131             if (this._start != temp._start)\r
132                 return false;\r
133             if (this._has_start != temp._has_start)\r
134                 return false;\r
135             if (this._end != temp._end)\r
136                 return false;\r
137             if (this._has_end != temp._has_end)\r
138                 return false;\r
139             if (this._inclusive != temp._inclusive)\r
140                 return false;\r
141             if (this._has_inclusive != temp._has_inclusive)\r
142                 return false;\r
143             return true;\r
144         }\r
145         return false;\r
146     } //-- boolean equals(java.lang.Object) \r
147 \r
148     /**\r
149      * Returns the value of field 'end'.\r
150      * \r
151      * @return int\r
152      * @return the value of field 'end'.\r
153      */\r
154     public int getEnd()\r
155     {\r
156         return this._end;\r
157     } //-- int getEnd() \r
158 \r
159     /**\r
160      * Returns the value of field 'inclusive'. The field\r
161      * 'inclusive' has the following description: when false, a\r
162      * consecutive range like 'start=1, end=2'\r
163      *  means the region lying after position 1 and before position\r
164      * 2\r
165      *  \r
166      * \r
167      * @return boolean\r
168      * @return the value of field 'inclusive'.\r
169      */\r
170     public boolean getInclusive()\r
171     {\r
172         return this._inclusive;\r
173     } //-- boolean getInclusive() \r
174 \r
175     /**\r
176      * Returns the value of field 'start'.\r
177      * \r
178      * @return int\r
179      * @return the value of field 'start'.\r
180      */\r
181     public int getStart()\r
182     {\r
183         return this._start;\r
184     } //-- int getStart() \r
185 \r
186     /**\r
187      * Method hasEnd\r
188      * \r
189      * \r
190      * \r
191      * @return boolean\r
192      */\r
193     public boolean hasEnd()\r
194     {\r
195         return this._has_end;\r
196     } //-- boolean hasEnd() \r
197 \r
198     /**\r
199      * Method hasInclusive\r
200      * \r
201      * \r
202      * \r
203      * @return boolean\r
204      */\r
205     public boolean hasInclusive()\r
206     {\r
207         return this._has_inclusive;\r
208     } //-- boolean hasInclusive() \r
209 \r
210     /**\r
211      * Method hasStart\r
212      * \r
213      * \r
214      * \r
215      * @return boolean\r
216      */\r
217     public boolean hasStart()\r
218     {\r
219         return this._has_start;\r
220     } //-- boolean hasStart() \r
221 \r
222     /**\r
223      * Method isValid\r
224      * \r
225      * \r
226      * \r
227      * @return boolean\r
228      */\r
229     public boolean isValid()\r
230     {\r
231         try {\r
232             validate();\r
233         }\r
234         catch (org.exolab.castor.xml.ValidationException vex) {\r
235             return false;\r
236         }\r
237         return true;\r
238     } //-- boolean isValid() \r
239 \r
240     /**\r
241      * Method marshal\r
242      * \r
243      * \r
244      * \r
245      * @param out\r
246      */\r
247     public void marshal(java.io.Writer out)\r
248         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
249     {\r
250         \r
251         Marshaller.marshal(this, out);\r
252     } //-- void marshal(java.io.Writer) \r
253 \r
254     /**\r
255      * Method marshal\r
256      * \r
257      * \r
258      * \r
259      * @param handler\r
260      */\r
261     public void marshal(org.xml.sax.ContentHandler handler)\r
262         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
263     {\r
264         \r
265         Marshaller.marshal(this, handler);\r
266     } //-- void marshal(org.xml.sax.ContentHandler) \r
267 \r
268     /**\r
269      * Sets the value of field 'end'.\r
270      * \r
271      * @param end the value of field 'end'.\r
272      */\r
273     public void setEnd(int end)\r
274     {\r
275         this._end = end;\r
276         this._has_end = true;\r
277     } //-- void setEnd(int) \r
278 \r
279     /**\r
280      * Sets the value of field 'inclusive'. The field 'inclusive'\r
281      * has the following description: when false, a consecutive\r
282      * range like 'start=1, end=2'\r
283      *  means the region lying after position 1 and before position\r
284      * 2\r
285      *  \r
286      * \r
287      * @param inclusive the value of field 'inclusive'.\r
288      */\r
289     public void setInclusive(boolean inclusive)\r
290     {\r
291         this._inclusive = inclusive;\r
292         this._has_inclusive = true;\r
293     } //-- void setInclusive(boolean) \r
294 \r
295     /**\r
296      * Sets the value of field 'start'.\r
297      * \r
298      * @param start the value of field 'start'.\r
299      */\r
300     public void setStart(int start)\r
301     {\r
302         this._start = start;\r
303         this._has_start = true;\r
304     } //-- void setStart(int) \r
305 \r
306     /**\r
307      * Method unmarshal\r
308      * \r
309      * \r
310      * \r
311      * @param reader\r
312      * @return Seg\r
313      */\r
314     public static org.vamsas.objects.core.Seg unmarshal(java.io.Reader reader)\r
315         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
316     {\r
317         return (org.vamsas.objects.core.Seg) Unmarshaller.unmarshal(org.vamsas.objects.core.Seg.class, reader);\r
318     } //-- org.vamsas.objects.core.Seg unmarshal(java.io.Reader) \r
319 \r
320     /**\r
321      * Method validate\r
322      * \r
323      */\r
324     public void validate()\r
325         throws org.exolab.castor.xml.ValidationException\r
326     {\r
327         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
328         validator.validate(this);\r
329     } //-- void validate() \r
330 \r
331 }\r