2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</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 org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
18 * a region from start to end, with flag for inclusivity of
\r
21 * @version $Revision$ $Date$
\r
23 public class Seg extends uk.ac.vamsas.client.Vobject
\r
24 implements java.io.Serializable
\r
28 //--------------------------/
\r
29 //- Class/Member Variables -/
\r
30 //--------------------------/
\r
38 * keeps track of state for field: _start
\r
40 private boolean _has_start;
\r
48 * keeps track of state for field: _end
\r
50 private boolean _has_end;
\r
53 * when false, a consecutive range like 'start=1, end=2'
\r
54 * means the region lying after position 1 and before position
\r
58 private boolean _inclusive;
\r
61 * keeps track of state for field: _inclusive
\r
63 private boolean _has_inclusive;
\r
81 public void deleteEnd(
\r
83 this._has_end= false;
\r
88 public void deleteInclusive(
\r
90 this._has_inclusive= false;
\r
95 public void deleteStart(
\r
97 this._has_start= false;
\r
101 * Overrides the java.lang.Object.equals method.
\r
104 * @return true if the objects are equal.
\r
106 public boolean equals(
\r
107 final java.lang.Object obj) {
\r
111 if (super.equals(obj)==false)
\r
114 if (obj instanceof Seg) {
\r
116 Seg temp = (Seg)obj;
\r
117 if (this._start != temp._start)
\r
119 if (this._has_start != temp._has_start)
\r
121 if (this._end != temp._end)
\r
123 if (this._has_end != temp._has_end)
\r
125 if (this._inclusive != temp._inclusive)
\r
127 if (this._has_inclusive != temp._has_inclusive)
\r
135 * Returns the value of field 'end'.
\r
137 * @return the value of field 'End'.
\r
145 * Returns the value of field 'inclusive'. The field
\r
146 * 'inclusive' has the following description: when false, a
\r
147 * consecutive range like 'start=1, end=2'
\r
148 * means the region lying after position 1 and before position
\r
152 * @return the value of field 'Inclusive'.
\r
154 public boolean getInclusive(
\r
156 return this._inclusive;
\r
160 * Returns the value of field 'start'.
\r
162 * @return the value of field 'Start'.
\r
164 public int getStart(
\r
166 return this._start;
\r
172 * @return true if at least one End has been added
\r
174 public boolean hasEnd(
\r
176 return this._has_end;
\r
180 * Method hasInclusive.
\r
182 * @return true if at least one Inclusive has been added
\r
184 public boolean hasInclusive(
\r
186 return this._has_inclusive;
\r
192 * @return true if at least one Start has been added
\r
194 public boolean hasStart(
\r
196 return this._has_start;
\r
200 * Overrides the java.lang.Object.hashCode method.
\r
202 * The following steps came from <b>Effective Java Programming
\r
203 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
205 * @return a hash code value for the object.
\r
207 public int hashCode(
\r
209 int result = super.hashCode();
\r
212 result = 37 * result + _start;
\r
213 result = 37 * result + _end;
\r
214 result = 37 * result + (_inclusive?0:1);
\r
220 * Returns the value of field 'inclusive'. The field
\r
221 * 'inclusive' has the following description: when false, a
\r
222 * consecutive range like 'start=1, end=2'
\r
223 * means the region lying after position 1 and before position
\r
227 * @return the value of field 'Inclusive'.
\r
229 public boolean isInclusive(
\r
231 return this._inclusive;
\r
237 * @return true if this object is valid according to the schema
\r
239 public boolean isValid(
\r
243 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
253 * @throws org.exolab.castor.xml.MarshalException if object is
\r
254 * null or if any SAXException is thrown during marshaling
\r
255 * @throws org.exolab.castor.xml.ValidationException if this
\r
256 * object is an invalid instance according to the schema
\r
258 public void marshal(
\r
259 final java.io.Writer out)
\r
260 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
261 Marshaller.marshal(this, out);
\r
268 * @throws java.io.IOException if an IOException occurs during
\r
270 * @throws org.exolab.castor.xml.ValidationException if this
\r
271 * object is an invalid instance according to the schema
\r
272 * @throws org.exolab.castor.xml.MarshalException if object is
\r
273 * null or if any SAXException is thrown during marshaling
\r
275 public void marshal(
\r
276 final org.xml.sax.ContentHandler handler)
\r
277 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
278 Marshaller.marshal(this, handler);
\r
282 * Sets the value of field 'end'.
\r
284 * @param end the value of field 'end'.
\r
286 public void setEnd(
\r
289 this._has_end = true;
\r
293 * Sets the value of field 'inclusive'. The field 'inclusive'
\r
294 * has the following description: when false, a consecutive
\r
295 * range like 'start=1, end=2'
\r
296 * means the region lying after position 1 and before position
\r
300 * @param inclusive the value of field 'inclusive'.
\r
302 public void setInclusive(
\r
303 final boolean inclusive) {
\r
304 this._inclusive = inclusive;
\r
305 this._has_inclusive = true;
\r
309 * Sets the value of field 'start'.
\r
311 * @param start the value of field 'start'.
\r
313 public void setStart(
\r
315 this._start = start;
\r
316 this._has_start = true;
\r
320 * Method unmarshal.
\r
323 * @throws org.exolab.castor.xml.MarshalException if object is
\r
324 * null or if any SAXException is thrown during marshaling
\r
325 * @throws org.exolab.castor.xml.ValidationException if this
\r
326 * object is an invalid instance according to the schema
\r
327 * @return the unmarshaled uk.ac.vamsas.objects.core.Seg
\r
329 public static uk.ac.vamsas.objects.core.Seg unmarshal(
\r
330 final java.io.Reader reader)
\r
331 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
332 return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Seg.class, reader);
\r
338 * @throws org.exolab.castor.xml.ValidationException if this
\r
339 * object is an invalid instance according to the schema
\r
341 public void validate(
\r
343 throws org.exolab.castor.xml.ValidationException {
\r
344 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
345 validator.validate(this);
\r