3877be5593269659abc8fde2905d7714cb71242a
[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             boolean thcycle;\r
81             boolean tmcycle;\r
82             if (this._i != temp._i)\r
83                 return false;\r
84             if (this._has_i != temp._has_i)\r
85                 return false;\r
86             return true;\r
87         }\r
88         return false;\r
89     }\r
90 \r
91     /**\r
92      * Returns the value of field 'i'.\r
93      * \r
94      * @return the value of field 'I'.\r
95      */\r
96     public int getI(\r
97     ) {\r
98         return this._i;\r
99     }\r
100 \r
101     /**\r
102      * Method hasI.\r
103      * \r
104      * @return true if at least one I has been added\r
105      */\r
106     public boolean hasI(\r
107     ) {\r
108         return this._has_i;\r
109     }\r
110 \r
111     /**\r
112      * Overrides the java.lang.Object.hashCode method.\r
113      * <p>\r
114      * The following steps came from <b>Effective Java Programming\r
115      * Language Guide</b> by Joshua Bloch, Chapter 3\r
116      * \r
117      * @return a hash code value for the object.\r
118      */\r
119     public int hashCode(\r
120     ) {\r
121         int result = super.hashCode();\r
122         \r
123         long tmp;\r
124         result = 37 * result + _i;\r
125         \r
126         return result;\r
127     }\r
128 \r
129     /**\r
130      * Method isValid.\r
131      * \r
132      * @return true if this object is valid according to the schema\r
133      */\r
134     public boolean isValid(\r
135     ) {\r
136         try {\r
137             validate();\r
138         } catch (org.exolab.castor.xml.ValidationException vex) {\r
139             return false;\r
140         }\r
141         return true;\r
142     }\r
143 \r
144     /**\r
145      * \r
146      * \r
147      * @param out\r
148      * @throws org.exolab.castor.xml.MarshalException if object is\r
149      * null or if any SAXException is thrown during marshaling\r
150      * @throws org.exolab.castor.xml.ValidationException if this\r
151      * object is an invalid instance according to the schema\r
152      */\r
153     public void marshal(\r
154             final java.io.Writer out)\r
155     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
156         Marshaller.marshal(this, out);\r
157     }\r
158 \r
159     /**\r
160      * \r
161      * \r
162      * @param handler\r
163      * @throws java.io.IOException if an IOException occurs during\r
164      * marshaling\r
165      * @throws org.exolab.castor.xml.ValidationException if this\r
166      * object is an invalid instance according to the schema\r
167      * @throws org.exolab.castor.xml.MarshalException if object is\r
168      * null or if any SAXException is thrown during marshaling\r
169      */\r
170     public void marshal(\r
171             final org.xml.sax.ContentHandler handler)\r
172     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
173         Marshaller.marshal(this, handler);\r
174     }\r
175 \r
176     /**\r
177      * Sets the value of field 'i'.\r
178      * \r
179      * @param i the value of field 'i'.\r
180      */\r
181     public void setI(\r
182             final int i) {\r
183         this._i = i;\r
184         this._has_i = true;\r
185     }\r
186 \r
187     /**\r
188      * Method unmarshal.\r
189      * \r
190      * @param reader\r
191      * @throws org.exolab.castor.xml.MarshalException if object is\r
192      * null or if any SAXException is thrown during marshaling\r
193      * @throws org.exolab.castor.xml.ValidationException if this\r
194      * object is an invalid instance according to the schema\r
195      * @return the unmarshaled uk.ac.vamsas.objects.core.Pos\r
196      */\r
197     public static uk.ac.vamsas.objects.core.Pos unmarshal(\r
198             final java.io.Reader reader)\r
199     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
200         return (uk.ac.vamsas.objects.core.Pos) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Pos.class, reader);\r
201     }\r
202 \r
203     /**\r
204      * \r
205      * \r
206      * @throws org.exolab.castor.xml.ValidationException if this\r
207      * object is an invalid instance according to the schema\r
208      */\r
209     public void validate(\r
210     )\r
211     throws org.exolab.castor.xml.ValidationException {\r
212         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
213         validator.validate(this);\r
214     }\r
215 \r
216 }\r