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.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 CoverageType.
26 *
27 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:07 $
28 */
29 public class CoverageType 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 private org.astrogrid.registry.beans.resource.dataservice.SpatialType _spatial;
42
43 /***
44 * the spectral coverage of a resource
45 */
46 private org.astrogrid.registry.beans.resource.dataservice.SpectralType _spectral;
47
48 /***
49 * the temporal coverage of a resource
50 */
51 private org.astrogrid.registry.beans.resource.dataservice.TemporalType _temporal;
52
53
54
55
56
57
58 public CoverageType() {
59 super();
60 }
61
62
63
64
65
66
67 /***
68 * Note: hashCode() has not been overriden
69 *
70 * @param obj
71 */
72 public boolean equals(java.lang.Object obj)
73 {
74 if ( this == obj )
75 return true;
76
77 if (super.equals(obj)==false)
78 return false;
79
80 if (obj instanceof CoverageType) {
81
82 CoverageType temp = (CoverageType)obj;
83 if (this._spatial != null) {
84 if (temp._spatial == null) return false;
85 else if (!(this._spatial.equals(temp._spatial)))
86 return false;
87 }
88 else if (temp._spatial != null)
89 return false;
90 if (this._spectral != null) {
91 if (temp._spectral == null) return false;
92 else if (!(this._spectral.equals(temp._spectral)))
93 return false;
94 }
95 else if (temp._spectral != null)
96 return false;
97 if (this._temporal != null) {
98 if (temp._temporal == null) return false;
99 else if (!(this._temporal.equals(temp._temporal)))
100 return false;
101 }
102 else if (temp._temporal != null)
103 return false;
104 return true;
105 }
106 return false;
107 }
108
109 /***
110 * Returns the value of field 'spatial'. The field 'spatial'
111 * has the following description: the spatial coverage of a
112 * resource
113 *
114 * @return the value of field 'spatial'.
115 */
116 public org.astrogrid.registry.beans.resource.dataservice.SpatialType getSpatial()
117 {
118 return this._spatial;
119 }
120
121 /***
122 * Returns the value of field 'spectral'. The field 'spectral'
123 * has the following description: the spectral coverage of a
124 * resource
125 *
126 * @return the value of field 'spectral'.
127 */
128 public org.astrogrid.registry.beans.resource.dataservice.SpectralType getSpectral()
129 {
130 return this._spectral;
131 }
132
133 /***
134 * Returns the value of field 'temporal'. The field 'temporal'
135 * has the following description: the temporal coverage of a
136 * resource
137 *
138 * @return the value of field 'temporal'.
139 */
140 public org.astrogrid.registry.beans.resource.dataservice.TemporalType getTemporal()
141 {
142 return this._temporal;
143 }
144
145 /***
146 * Method isValid
147 */
148 public boolean isValid()
149 {
150 try {
151 validate();
152 }
153 catch (org.exolab.castor.xml.ValidationException vex) {
154 return false;
155 }
156 return true;
157 }
158
159 /***
160 * Method marshal
161 *
162 * @param out
163 */
164 public void marshal(java.io.Writer out)
165 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
166 {
167
168 Marshaller.marshal(this, out);
169 }
170
171 /***
172 * Method marshal
173 *
174 * @param handler
175 */
176 public void marshal(org.xml.sax.ContentHandler handler)
177 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
178 {
179
180 Marshaller.marshal(this, handler);
181 }
182
183 /***
184 * Sets the value of field 'spatial'. The field 'spatial' has
185 * the following description: the spatial coverage of a
186 * resource
187 *
188 * @param spatial the value of field 'spatial'.
189 */
190 public void setSpatial(org.astrogrid.registry.beans.resource.dataservice.SpatialType spatial)
191 {
192 this._spatial = spatial;
193 }
194
195 /***
196 * Sets the value of field 'spectral'. The field 'spectral' has
197 * the following description: the spectral coverage of a
198 * resource
199 *
200 * @param spectral the value of field 'spectral'.
201 */
202 public void setSpectral(org.astrogrid.registry.beans.resource.dataservice.SpectralType spectral)
203 {
204 this._spectral = spectral;
205 }
206
207 /***
208 * Sets the value of field 'temporal'. The field 'temporal' has
209 * the following description: the temporal coverage of a
210 * resource
211 *
212 * @param temporal the value of field 'temporal'.
213 */
214 public void setTemporal(org.astrogrid.registry.beans.resource.dataservice.TemporalType temporal)
215 {
216 this._temporal = temporal;
217 }
218
219 /***
220 * Method unmarshalCoverageType
221 *
222 * @param reader
223 */
224 public static org.astrogrid.registry.beans.resource.dataservice.CoverageType unmarshalCoverageType(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.CoverageType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.dataservice.CoverageType.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 }