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
119 if (this._start != temp._start)
\r
121 if (this._has_start != temp._has_start)
\r
123 if (this._end != temp._end)
\r
125 if (this._has_end != temp._has_end)
\r
127 if (this._inclusive != temp._inclusive)
\r
129 if (this._has_inclusive != temp._has_inclusive)
\r
137 * Returns the value of field 'end'.
\r
139 * @return the value of field 'End'.
\r
147 * Returns the value of field 'inclusive'. The field
\r
148 * 'inclusive' has the following description: when false, a
\r
149 * consecutive range like 'start=1, end=2'
\r
150 * means the region lying after position 1 and before position
\r
154 * @return the value of field 'Inclusive'.
\r
156 public boolean getInclusive(
\r
158 return this._inclusive;
\r
162 * Returns the value of field 'start'.
\r
164 * @return the value of field 'Start'.
\r
166 public int getStart(
\r
168 return this._start;
\r
174 * @return true if at least one End has been added
\r
176 public boolean hasEnd(
\r
178 return this._has_end;
\r
182 * Method hasInclusive.
\r
184 * @return true if at least one Inclusive has been added
\r
186 public boolean hasInclusive(
\r
188 return this._has_inclusive;
\r
194 * @return true if at least one Start has been added
\r
196 public boolean hasStart(
\r
198 return this._has_start;
\r
202 * Overrides the java.lang.Object.hashCode method.
\r
204 * The following steps came from <b>Effective Java Programming
\r
205 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
207 * @return a hash code value for the object.
\r
209 public int hashCode(
\r
211 int result = super.hashCode();
\r
214 result = 37 * result + _start;
\r
215 result = 37 * result + _end;
\r
216 result = 37 * result + (_inclusive?0:1);
\r
222 * Returns the value of field 'inclusive'. The field
\r
223 * 'inclusive' has the following description: when false, a
\r
224 * consecutive range like 'start=1, end=2'
\r
225 * means the region lying after position 1 and before position
\r
229 * @return the value of field 'Inclusive'.
\r
231 public boolean isInclusive(
\r
233 return this._inclusive;
\r
239 * @return true if this object is valid according to the schema
\r
241 public boolean isValid(
\r
245 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
255 * @throws org.exolab.castor.xml.MarshalException if object is
\r
256 * null or if any SAXException is thrown during marshaling
\r
257 * @throws org.exolab.castor.xml.ValidationException if this
\r
258 * object is an invalid instance according to the schema
\r
260 public void marshal(
\r
261 final java.io.Writer out)
\r
262 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
263 Marshaller.marshal(this, out);
\r
270 * @throws java.io.IOException if an IOException occurs during
\r
272 * @throws org.exolab.castor.xml.ValidationException if this
\r
273 * object is an invalid instance according to the schema
\r
274 * @throws org.exolab.castor.xml.MarshalException if object is
\r
275 * null or if any SAXException is thrown during marshaling
\r
277 public void marshal(
\r
278 final org.xml.sax.ContentHandler handler)
\r
279 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
280 Marshaller.marshal(this, handler);
\r
284 * Sets the value of field 'end'.
\r
286 * @param end the value of field 'end'.
\r
288 public void setEnd(
\r
291 this._has_end = true;
\r
295 * Sets the value of field 'inclusive'. The field 'inclusive'
\r
296 * has the following description: when false, a consecutive
\r
297 * range like 'start=1, end=2'
\r
298 * means the region lying after position 1 and before position
\r
302 * @param inclusive the value of field 'inclusive'.
\r
304 public void setInclusive(
\r
305 final boolean inclusive) {
\r
306 this._inclusive = inclusive;
\r
307 this._has_inclusive = true;
\r
311 * Sets the value of field 'start'.
\r
313 * @param start the value of field 'start'.
\r
315 public void setStart(
\r
317 this._start = start;
\r
318 this._has_start = true;
\r
322 * Method unmarshal.
\r
325 * @throws org.exolab.castor.xml.MarshalException if object is
\r
326 * null or if any SAXException is thrown during marshaling
\r
327 * @throws org.exolab.castor.xml.ValidationException if this
\r
328 * object is an invalid instance according to the schema
\r
329 * @return the unmarshaled uk.ac.vamsas.objects.core.Seg
\r
331 public static uk.ac.vamsas.objects.core.Seg unmarshal(
\r
332 final java.io.Reader reader)
\r
333 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
334 return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Seg.class, reader);
\r
340 * @throws org.exolab.castor.xml.ValidationException if this
\r
341 * object is an invalid instance according to the schema
\r
343 public void validate(
\r
345 throws org.exolab.castor.xml.ValidationException {
\r
346 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
347 validator.validate(this);
\r