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