1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.dataservice;
9
10
11
12
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.astrogrid.registry.beans.resource.dataservice.types.CoordFrameType;
19 import org.exolab.castor.xml.MarshalException;
20 import org.exolab.castor.xml.Marshaller;
21 import org.exolab.castor.xml.Unmarshaller;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 * Class CoordRangeType.
27 *
28 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:08 $
29 */
30 public class CoordRangeType extends org.astrogrid.registry.beans.resource.dataservice.RegionType
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39 /***
40 * a coordinate system frame
41 *
42 */
43 private org.astrogrid.registry.beans.resource.dataservice.types.CoordFrameType _coordFrame;
44
45 /***
46 * The range in longitude
47 */
48 private org.astrogrid.registry.beans.resource.dataservice.Long _long;
49
50 /***
51 * The range in latitude
52 */
53 private org.astrogrid.registry.beans.resource.dataservice.Lat _lat;
54
55
56
57
58
59
60 public CoordRangeType() {
61 super();
62 }
63
64
65
66
67
68
69 /***
70 * Note: hashCode() has not been overriden
71 *
72 * @param obj
73 */
74 public boolean equals(java.lang.Object obj)
75 {
76 if ( this == obj )
77 return true;
78
79 if (super.equals(obj)==false)
80 return false;
81
82 if (obj instanceof CoordRangeType) {
83
84 CoordRangeType temp = (CoordRangeType)obj;
85 if (this._coordFrame != null) {
86 if (temp._coordFrame == null) return false;
87 else if (!(this._coordFrame.equals(temp._coordFrame)))
88 return false;
89 }
90 else if (temp._coordFrame != null)
91 return false;
92 if (this._long != null) {
93 if (temp._long == null) return false;
94 else if (!(this._long.equals(temp._long)))
95 return false;
96 }
97 else if (temp._long != null)
98 return false;
99 if (this._lat != null) {
100 if (temp._lat == null) return false;
101 else if (!(this._lat.equals(temp._lat)))
102 return false;
103 }
104 else if (temp._lat != null)
105 return false;
106 return true;
107 }
108 return false;
109 }
110
111 /***
112 * Returns the value of field 'coordFrame'. The field
113 * 'coordFrame' has the following description: a coordinate
114 * system frame
115 *
116 *
117 * @return the value of field 'coordFrame'.
118 */
119 public org.astrogrid.registry.beans.resource.dataservice.types.CoordFrameType getCoordFrame()
120 {
121 return this._coordFrame;
122 }
123
124 /***
125 * Returns the value of field 'lat'. The field 'lat' has the
126 * following description: The range in latitude
127 *
128 * @return the value of field 'lat'.
129 */
130 public org.astrogrid.registry.beans.resource.dataservice.Lat getLat()
131 {
132 return this._lat;
133 }
134
135 /***
136 * Returns the value of field 'long'. The field 'long' has the
137 * following description: The range in longitude
138 *
139 * @return the value of field 'long'.
140 */
141 public org.astrogrid.registry.beans.resource.dataservice.Long getLong()
142 {
143 return this._long;
144 }
145
146 /***
147 * Method isValid
148 */
149 public boolean isValid()
150 {
151 try {
152 validate();
153 }
154 catch (org.exolab.castor.xml.ValidationException vex) {
155 return false;
156 }
157 return true;
158 }
159
160 /***
161 * Method marshal
162 *
163 * @param out
164 */
165 public void marshal(java.io.Writer out)
166 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
167 {
168
169 Marshaller.marshal(this, out);
170 }
171
172 /***
173 * Method marshal
174 *
175 * @param handler
176 */
177 public void marshal(org.xml.sax.ContentHandler handler)
178 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
179 {
180
181 Marshaller.marshal(this, handler);
182 }
183
184 /***
185 * Sets the value of field 'coordFrame'. The field 'coordFrame'
186 * has the following description: a coordinate system frame
187 *
188 *
189 * @param coordFrame the value of field 'coordFrame'.
190 */
191 public void setCoordFrame(org.astrogrid.registry.beans.resource.dataservice.types.CoordFrameType coordFrame)
192 {
193 this._coordFrame = coordFrame;
194 }
195
196 /***
197 * Sets the value of field 'lat'. The field 'lat' has the
198 * following description: The range in latitude
199 *
200 * @param lat the value of field 'lat'.
201 */
202 public void setLat(org.astrogrid.registry.beans.resource.dataservice.Lat lat)
203 {
204 this._lat = lat;
205 }
206
207 /***
208 * Sets the value of field 'long'. The field 'long' has the
209 * following description: The range in longitude
210 *
211 * @param _long
212 * @param long the value of field 'long'.
213 */
214 public void setLong(org.astrogrid.registry.beans.resource.dataservice.Long _long)
215 {
216 this._long = _long;
217 }
218
219 /***
220 * Method unmarshalCoordRangeType
221 *
222 * @param reader
223 */
224 public static org.astrogrid.registry.beans.resource.dataservice.CoordRangeType unmarshalCoordRangeType(java.io.Reader reader)
225 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
226 {
227 return (org.astrogrid.registry.beans.resource.dataservice.CoordRangeType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.dataservice.CoordRangeType.class, reader);
228 }
229
230 /***
231 * Method validate
232 */
233 public void validate()
234 throws org.exolab.castor.xml.ValidationException
235 {
236 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
237 validator.validate(this);
238 }
239
240 }