af7ebb61a876c0619ba5911631897c7b821b680e
[vamsas.git] / src / uk / ac / vamsas / objects / core / MapList.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package uk.ac.vamsas.objects.core;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Class MapList.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class MapList extends uk.ac.vamsas.client.Vobject \r
23 implements java.io.Serializable\r
24 {\r
25 \r
26 \r
27       //--------------------------/\r
28      //- Class/Member Variables -/\r
29     //--------------------------/\r
30 \r
31     /**\r
32      * Offset to first position in dataset sequence record that\r
33      * start\r
34      *  position on 'onto' maps to \r
35      */\r
36     private long _from = 0;\r
37 \r
38     /**\r
39      * keeps track of state for field: _from\r
40      */\r
41     private boolean _has_from;\r
42 \r
43     /**\r
44      * Offset to last position in dataset sequence record that end\r
45      *  position on 'onto' maps to \r
46      */\r
47     private long _to = 0;\r
48 \r
49     /**\r
50      * keeps track of state for field: _to\r
51      */\r
52     private boolean _has_to;\r
53 \r
54     /**\r
55      * Offset to first position in database entry that first (or\r
56      * offset)\r
57      *  position in sequence maps to \r
58      */\r
59     private long _start;\r
60 \r
61     /**\r
62      * keeps track of state for field: _start\r
63      */\r
64     private boolean _has_start;\r
65 \r
66     /**\r
67      * Offset to last position in database entry that last (offset)\r
68      *  position in sequence maps to \r
69      */\r
70     private long _end;\r
71 \r
72     /**\r
73      * keeps track of state for field: _end\r
74      */\r
75     private boolean _has_end;\r
76 \r
77 \r
78       //----------------/\r
79      //- Constructors -/\r
80     //----------------/\r
81 \r
82     public MapList() {\r
83         super();\r
84     }\r
85 \r
86 \r
87       //-----------/\r
88      //- Methods -/\r
89     //-----------/\r
90 \r
91     /**\r
92      */\r
93     public void deleteEnd(\r
94     ) {\r
95         this._has_end= false;\r
96     }\r
97 \r
98     /**\r
99      */\r
100     public void deleteFrom(\r
101     ) {\r
102         this._has_from= false;\r
103     }\r
104 \r
105     /**\r
106      */\r
107     public void deleteStart(\r
108     ) {\r
109         this._has_start= false;\r
110     }\r
111 \r
112     /**\r
113      */\r
114     public void deleteTo(\r
115     ) {\r
116         this._has_to= false;\r
117     }\r
118 \r
119     /**\r
120      * Overrides the java.lang.Object.equals method.\r
121      * \r
122      * @param obj\r
123      * @return true if the objects are equal.\r
124      */\r
125     public boolean equals(\r
126             final java.lang.Object obj) {\r
127         if ( this == obj )\r
128             return true;\r
129         \r
130         if (super.equals(obj)==false)\r
131             return false;\r
132         \r
133         if (obj instanceof MapList) {\r
134         \r
135             MapList temp = (MapList)obj;\r
136             if (this._from != temp._from)\r
137                 return false;\r
138             if (this._has_from != temp._has_from)\r
139                 return false;\r
140             if (this._to != temp._to)\r
141                 return false;\r
142             if (this._has_to != temp._has_to)\r
143                 return false;\r
144             if (this._start != temp._start)\r
145                 return false;\r
146             if (this._has_start != temp._has_start)\r
147                 return false;\r
148             if (this._end != temp._end)\r
149                 return false;\r
150             if (this._has_end != temp._has_end)\r
151                 return false;\r
152             return true;\r
153         }\r
154         return false;\r
155     }\r
156 \r
157     /**\r
158      * Returns the value of field 'end'. The field 'end' has the\r
159      * following description: Offset to last position in database\r
160      * entry that last (offset)\r
161      *  position in sequence maps to \r
162      * \r
163      * @return the value of field 'End'.\r
164      */\r
165     public long getEnd(\r
166     ) {\r
167         return this._end;\r
168     }\r
169 \r
170     /**\r
171      * Returns the value of field 'from'. The field 'from' has the\r
172      * following description: Offset to first position in dataset\r
173      * sequence record that start\r
174      *  position on 'onto' maps to \r
175      * \r
176      * @return the value of field 'From'.\r
177      */\r
178     public long getFrom(\r
179     ) {\r
180         return this._from;\r
181     }\r
182 \r
183     /**\r
184      * Returns the value of field 'start'. The field 'start' has\r
185      * the following description: Offset to first position in\r
186      * database entry that first (or offset)\r
187      *  position in sequence maps to \r
188      * \r
189      * @return the value of field 'Start'.\r
190      */\r
191     public long getStart(\r
192     ) {\r
193         return this._start;\r
194     }\r
195 \r
196     /**\r
197      * Returns the value of field 'to'. The field 'to' has the\r
198      * following description: Offset to last position in dataset\r
199      * sequence record that end\r
200      *  position on 'onto' maps to \r
201      * \r
202      * @return the value of field 'To'.\r
203      */\r
204     public long getTo(\r
205     ) {\r
206         return this._to;\r
207     }\r
208 \r
209     /**\r
210      * Method hasEnd.\r
211      * \r
212      * @return true if at least one End has been added\r
213      */\r
214     public boolean hasEnd(\r
215     ) {\r
216         return this._has_end;\r
217     }\r
218 \r
219     /**\r
220      * Method hasFrom.\r
221      * \r
222      * @return true if at least one From has been added\r
223      */\r
224     public boolean hasFrom(\r
225     ) {\r
226         return this._has_from;\r
227     }\r
228 \r
229     /**\r
230      * Method hasStart.\r
231      * \r
232      * @return true if at least one Start has been added\r
233      */\r
234     public boolean hasStart(\r
235     ) {\r
236         return this._has_start;\r
237     }\r
238 \r
239     /**\r
240      * Method hasTo.\r
241      * \r
242      * @return true if at least one To has been added\r
243      */\r
244     public boolean hasTo(\r
245     ) {\r
246         return this._has_to;\r
247     }\r
248 \r
249     /**\r
250      * Overrides the java.lang.Object.hashCode method.\r
251      * <p>\r
252      * The following steps came from <b>Effective Java Programming\r
253      * Language Guide</b> by Joshua Bloch, Chapter 3\r
254      * \r
255      * @return a hash code value for the object.\r
256      */\r
257     public int hashCode(\r
258     ) {\r
259         int result = super.hashCode();\r
260         \r
261         long tmp;\r
262         result = 37 * result + (int)(_from^(_from>>>32));\r
263         result = 37 * result + (int)(_to^(_to>>>32));\r
264         result = 37 * result + (int)(_start^(_start>>>32));\r
265         result = 37 * result + (int)(_end^(_end>>>32));\r
266         \r
267         return result;\r
268     }\r
269 \r
270     /**\r
271      * Method isValid.\r
272      * \r
273      * @return true if this object is valid according to the schema\r
274      */\r
275     public boolean isValid(\r
276     ) {\r
277         try {\r
278             validate();\r
279         } catch (org.exolab.castor.xml.ValidationException vex) {\r
280             return false;\r
281         }\r
282         return true;\r
283     }\r
284 \r
285     /**\r
286      * \r
287      * \r
288      * @param out\r
289      * @throws org.exolab.castor.xml.MarshalException if object is\r
290      * null or if any SAXException is thrown during marshaling\r
291      * @throws org.exolab.castor.xml.ValidationException if this\r
292      * object is an invalid instance according to the schema\r
293      */\r
294     public void marshal(\r
295             final java.io.Writer out)\r
296     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
297         Marshaller.marshal(this, out);\r
298     }\r
299 \r
300     /**\r
301      * \r
302      * \r
303      * @param handler\r
304      * @throws java.io.IOException if an IOException occurs during\r
305      * marshaling\r
306      * @throws org.exolab.castor.xml.ValidationException if this\r
307      * object is an invalid instance according to the schema\r
308      * @throws org.exolab.castor.xml.MarshalException if object is\r
309      * null or if any SAXException is thrown during marshaling\r
310      */\r
311     public void marshal(\r
312             final org.xml.sax.ContentHandler handler)\r
313     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
314         Marshaller.marshal(this, handler);\r
315     }\r
316 \r
317     /**\r
318      * Sets the value of field 'end'. The field 'end' has the\r
319      * following description: Offset to last position in database\r
320      * entry that last (offset)\r
321      *  position in sequence maps to \r
322      * \r
323      * @param end the value of field 'end'.\r
324      */\r
325     public void setEnd(\r
326             final long end) {\r
327         this._end = end;\r
328         this._has_end = true;\r
329     }\r
330 \r
331     /**\r
332      * Sets the value of field 'from'. The field 'from' has the\r
333      * following description: Offset to first position in dataset\r
334      * sequence record that start\r
335      *  position on 'onto' maps to \r
336      * \r
337      * @param from the value of field 'from'.\r
338      */\r
339     public void setFrom(\r
340             final long from) {\r
341         this._from = from;\r
342         this._has_from = true;\r
343     }\r
344 \r
345     /**\r
346      * Sets the value of field 'start'. The field 'start' has the\r
347      * following description: Offset to first position in database\r
348      * entry that first (or offset)\r
349      *  position in sequence maps to \r
350      * \r
351      * @param start the value of field 'start'.\r
352      */\r
353     public void setStart(\r
354             final long start) {\r
355         this._start = start;\r
356         this._has_start = true;\r
357     }\r
358 \r
359     /**\r
360      * Sets the value of field 'to'. The field 'to' has the\r
361      * following description: Offset to last position in dataset\r
362      * sequence record that end\r
363      *  position on 'onto' maps to \r
364      * \r
365      * @param to the value of field 'to'.\r
366      */\r
367     public void setTo(\r
368             final long to) {\r
369         this._to = to;\r
370         this._has_to = true;\r
371     }\r
372 \r
373     /**\r
374      * Method unmarshal.\r
375      * \r
376      * @param reader\r
377      * @throws org.exolab.castor.xml.MarshalException if object is\r
378      * null or if any SAXException is thrown during marshaling\r
379      * @throws org.exolab.castor.xml.ValidationException if this\r
380      * object is an invalid instance according to the schema\r
381      * @return the unmarshaled uk.ac.vamsas.objects.core.MapList\r
382      */\r
383     public static uk.ac.vamsas.objects.core.MapList unmarshal(\r
384             final java.io.Reader reader)\r
385     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
386         return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapList.class, reader);\r
387     }\r
388 \r
389     /**\r
390      * \r
391      * \r
392      * @throws org.exolab.castor.xml.ValidationException if this\r
393      * object is an invalid instance according to the schema\r
394      */\r
395     public void validate(\r
396     )\r
397     throws org.exolab.castor.xml.ValidationException {\r
398         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
399         validator.validate(this);\r
400     }\r
401 \r
402 }\r