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