7a9827669327e7267dac9b007cd5280ed2e8a294
[vamsas.git] / src / uk / ac / vamsas / objects / core / Pos.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  * a position within the associated object's coordinate system\r
19  *  \r
20  * \r
21  * @version $Revision$ $Date$\r
22  */\r
23 public class Pos extends uk.ac.vamsas.client.Vobject \r
24 implements java.io.Serializable\r
25 {\r
26 \r
27 \r
28       //--------------------------/\r
29      //- Class/Member Variables -/\r
30     //--------------------------/\r
31 \r
32     /**\r
33      * Field _i.\r
34      */\r
35     private int _i;\r
36 \r
37     /**\r
38      * keeps track of state for field: _i\r
39      */\r
40     private boolean _has_i;\r
41 \r
42 \r
43       //----------------/\r
44      //- Constructors -/\r
45     //----------------/\r
46 \r
47     public Pos() {\r
48         super();\r
49     }\r
50 \r
51 \r
52       //-----------/\r
53      //- Methods -/\r
54     //-----------/\r
55 \r
56     /**\r
57      */\r
58     public void deleteI(\r
59     ) {\r
60         this._has_i= false;\r
61     }\r
62 \r
63     /**\r
64      * Overrides the java.lang.Object.equals method.\r
65      * \r
66      * @param obj\r
67      * @return true if the objects are equal.\r
68      */\r
69     public boolean equals(\r
70             final java.lang.Object obj) {\r
71         if ( this == obj )\r
72             return true;\r
73         \r
74         if (super.equals(obj)==false)\r
75             return false;\r
76         \r
77         if (obj instanceof Pos) {\r
78         \r
79             Pos temp = (Pos)obj;\r
80             if (this._i != temp._i)\r
81                 return false;\r
82             if (this._has_i != temp._has_i)\r
83                 return false;\r
84             return true;\r
85         }\r
86         return false;\r
87     }\r
88 \r
89     /**\r
90      * Returns the value of field 'i'.\r
91      * \r
92      * @return the value of field 'I'.\r
93      */\r
94     public int getI(\r
95     ) {\r
96         return this._i;\r
97     }\r
98 \r
99     /**\r
100      * Method hasI.\r
101      * \r
102      * @return true if at least one I has been added\r
103      */\r
104     public boolean hasI(\r
105     ) {\r
106         return this._has_i;\r
107     }\r
108 \r
109     /**\r
110      * Overrides the java.lang.Object.hashCode method.\r
111      * <p>\r
112      * The following steps came from <b>Effective Java Programming\r
113      * Language Guide</b> by Joshua Bloch, Chapter 3\r
114      * \r
115      * @return a hash code value for the object.\r
116      */\r
117     public int hashCode(\r
118     ) {\r
119         int result = super.hashCode();\r
120         \r
121         long tmp;\r
122         result = 37 * result + _i;\r
123         \r
124         return result;\r
125     }\r
126 \r
127     /**\r
128      * Method isValid.\r
129      * \r
130      * @return true if this object is valid according to the schema\r
131      */\r
132     public boolean isValid(\r
133     ) {\r
134         try {\r
135             validate();\r
136         } catch (org.exolab.castor.xml.ValidationException vex) {\r
137             return false;\r
138         }\r
139         return true;\r
140     }\r
141 \r
142     /**\r
143      * \r
144      * \r
145      * @param out\r
146      * @throws org.exolab.castor.xml.MarshalException if object is\r
147      * null or if any SAXException is thrown during marshaling\r
148      * @throws org.exolab.castor.xml.ValidationException if this\r
149      * object is an invalid instance according to the schema\r
150      */\r
151     public void marshal(\r
152             final java.io.Writer out)\r
153     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
154         Marshaller.marshal(this, out);\r
155     }\r
156 \r
157     /**\r
158      * \r
159      * \r
160      * @param handler\r
161      * @throws java.io.IOException if an IOException occurs during\r
162      * marshaling\r
163      * @throws org.exolab.castor.xml.ValidationException if this\r
164      * object is an invalid instance according to the schema\r
165      * @throws org.exolab.castor.xml.MarshalException if object is\r
166      * null or if any SAXException is thrown during marshaling\r
167      */\r
168     public void marshal(\r
169             final org.xml.sax.ContentHandler handler)\r
170     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
171         Marshaller.marshal(this, handler);\r
172     }\r
173 \r
174     /**\r
175      * Sets the value of field 'i'.\r
176      * \r
177      * @param i the value of field 'i'.\r
178      */\r
179     public void setI(\r
180             final int i) {\r
181         this._i = i;\r
182         this._has_i = true;\r
183     }\r
184 \r
185     /**\r
186      * Method unmarshal.\r
187      * \r
188      * @param reader\r
189      * @throws org.exolab.castor.xml.MarshalException if object is\r
190      * null or if any SAXException is thrown during marshaling\r
191      * @throws org.exolab.castor.xml.ValidationException if this\r
192      * object is an invalid instance according to the schema\r
193      * @return the unmarshaled uk.ac.vamsas.objects.core.Pos\r
194      */\r
195     public static uk.ac.vamsas.objects.core.Pos unmarshal(\r
196             final java.io.Reader reader)\r
197     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
198         return (uk.ac.vamsas.objects.core.Pos) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Pos.class, reader);\r
199     }\r
200 \r
201     /**\r
202      * \r
203      * \r
204      * @throws org.exolab.castor.xml.ValidationException if this\r
205      * object is an invalid instance according to the schema\r
206      */\r
207     public void validate(\r
208     )\r
209     throws org.exolab.castor.xml.ValidationException {\r
210         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
211         validator.validate(this);\r
212     }\r
213 \r
214 }\r