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