2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
\r
8 package uk.ac.vamsas.objects.core;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\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
25 * a region from start to end, with flag for inclusivity of
\r
28 * @version $Revision$ $Date$
\r
30 public class Seg extends uk.ac.vamsas.client.Vobject
\r
31 implements java.io.Serializable
\r
35 //--------------------------/
\r
36 //- Class/Member Variables -/
\r
37 //--------------------------/
\r
45 * keeps track of state for field: _start
\r
47 private boolean _has_start;
\r
55 * keeps track of state for field: _end
\r
57 private boolean _has_end;
\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
65 private boolean _inclusive;
\r
68 * keeps track of state for field: _inclusive
\r
70 private boolean _has_inclusive;
\r
80 } //-- uk.ac.vamsas.objects.core.Seg()
\r
91 public void deleteEnd()
\r
93 this._has_end= false;
\r
94 } //-- void deleteEnd()
\r
97 * Method deleteInclusive
\r
100 public void deleteInclusive()
\r
102 this._has_inclusive= false;
\r
103 } //-- void deleteInclusive()
\r
106 * Method deleteStart
\r
109 public void deleteStart()
\r
111 this._has_start= false;
\r
112 } //-- void deleteStart()
\r
115 * Note: hashCode() has not been overriden
\r
120 public boolean equals(java.lang.Object obj)
\r
125 if (super.equals(obj)==false)
\r
128 if (obj instanceof Seg) {
\r
130 Seg temp = (Seg)obj;
\r
131 if (this._start != temp._start)
\r
133 if (this._has_start != temp._has_start)
\r
135 if (this._end != temp._end)
\r
137 if (this._has_end != temp._has_end)
\r
139 if (this._inclusive != temp._inclusive)
\r
141 if (this._has_inclusive != temp._has_inclusive)
\r
146 } //-- boolean equals(java.lang.Object)
\r
149 * Returns the value of field 'end'.
\r
152 * @return the value of field 'end'.
\r
154 public int getEnd()
\r
157 } //-- int getEnd()
\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
168 * @return the value of field 'inclusive'.
\r
170 public boolean getInclusive()
\r
172 return this._inclusive;
\r
173 } //-- boolean getInclusive()
\r
176 * Returns the value of field 'start'.
\r
179 * @return the value of field 'start'.
\r
181 public int getStart()
\r
183 return this._start;
\r
184 } //-- int getStart()
\r
193 public boolean hasEnd()
\r
195 return this._has_end;
\r
196 } //-- boolean hasEnd()
\r
199 * Method hasInclusive
\r
205 public boolean hasInclusive()
\r
207 return this._has_inclusive;
\r
208 } //-- boolean hasInclusive()
\r
217 public boolean hasStart()
\r
219 return this._has_start;
\r
220 } //-- boolean hasStart()
\r
229 public boolean isValid()
\r
234 catch (org.exolab.castor.xml.ValidationException vex) {
\r
238 } //-- boolean isValid()
\r
247 public void marshal(java.io.Writer out)
\r
248 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
251 Marshaller.marshal(this, out);
\r
252 } //-- void marshal(java.io.Writer)
\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
265 Marshaller.marshal(this, handler);
\r
266 } //-- void marshal(org.xml.sax.ContentHandler)
\r
269 * Sets the value of field 'end'.
\r
271 * @param end the value of field 'end'.
\r
273 public void setEnd(int end)
\r
276 this._has_end = true;
\r
277 } //-- void setEnd(int)
\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
287 * @param inclusive the value of field 'inclusive'.
\r
289 public void setInclusive(boolean inclusive)
\r
291 this._inclusive = inclusive;
\r
292 this._has_inclusive = true;
\r
293 } //-- void setInclusive(boolean)
\r
296 * Sets the value of field 'start'.
\r
298 * @param start the value of field 'start'.
\r
300 public void setStart(int start)
\r
302 this._start = start;
\r
303 this._has_start = true;
\r
304 } //-- void setStart(int)
\r
314 public static uk.ac.vamsas.objects.core.Seg unmarshal(java.io.Reader reader)
\r
315 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
317 return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Seg.class, reader);
\r
318 } //-- uk.ac.vamsas.objects.core.Seg unmarshal(java.io.Reader)
\r
324 public void validate()
\r
325 throws org.exolab.castor.xml.ValidationException
\r
327 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
328 validator.validate(this);
\r
329 } //-- void validate()
\r