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 WavelengthRange.
26 *
27 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:26 $
28 */
29 public class WavelengthRange extends org.astrogrid.common.bean.BaseBean
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * The minimum wavelength
40 *
41 */
42 private float _min;
43
44 /***
45 * keeps track of state for field: _min
46 */
47 private boolean _has_min;
48
49 /***
50 * The maximum wavelength
51 *
52 */
53 private float _max;
54
55 /***
56 * keeps track of state for field: _max
57 */
58 private boolean _has_max;
59
60
61
62
63
64
65 public WavelengthRange() {
66 super();
67 }
68
69
70
71
72
73
74 /***
75 * Note: hashCode() has not been overriden
76 *
77 * @param obj
78 */
79 public boolean equals(java.lang.Object obj)
80 {
81 if ( this == obj )
82 return true;
83
84 if (super.equals(obj)==false)
85 return false;
86
87 if (obj instanceof WavelengthRange) {
88
89 WavelengthRange temp = (WavelengthRange)obj;
90 if (this._min != temp._min)
91 return false;
92 if (this._has_min != temp._has_min)
93 return false;
94 if (this._max != temp._max)
95 return false;
96 if (this._has_max != temp._has_max)
97 return false;
98 return true;
99 }
100 return false;
101 }
102
103 /***
104 * Returns the value of field 'max'. The field 'max' has the
105 * following description: The maximum wavelength
106 *
107 *
108 * @return the value of field 'max'.
109 */
110 public float getMax()
111 {
112 return this._max;
113 }
114
115 /***
116 * Returns the value of field 'min'. The field 'min' has the
117 * following description: The minimum wavelength
118 *
119 *
120 * @return the value of field 'min'.
121 */
122 public float getMin()
123 {
124 return this._min;
125 }
126
127 /***
128 * Method hasMax
129 */
130 public boolean hasMax()
131 {
132 return this._has_max;
133 }
134
135 /***
136 * Method hasMin
137 */
138 public boolean hasMin()
139 {
140 return this._has_min;
141 }
142
143 /***
144 * Method isValid
145 */
146 public boolean isValid()
147 {
148 try {
149 validate();
150 }
151 catch (org.exolab.castor.xml.ValidationException vex) {
152 return false;
153 }
154 return true;
155 }
156
157 /***
158 * Method marshal
159 *
160 * @param out
161 */
162 public void marshal(java.io.Writer out)
163 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
164 {
165
166 Marshaller.marshal(this, out);
167 }
168
169 /***
170 * Method marshal
171 *
172 * @param handler
173 */
174 public void marshal(org.xml.sax.ContentHandler handler)
175 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
176 {
177
178 Marshaller.marshal(this, handler);
179 }
180
181 /***
182 * Sets the value of field 'max'. The field 'max' has the
183 * following description: The maximum wavelength
184 *
185 *
186 * @param max the value of field 'max'.
187 */
188 public void setMax(float max)
189 {
190 this._max = max;
191 this._has_max = true;
192 }
193
194 /***
195 * Sets the value of field 'min'. The field 'min' has the
196 * following description: The minimum wavelength
197 *
198 *
199 * @param min the value of field 'min'.
200 */
201 public void setMin(float min)
202 {
203 this._min = min;
204 this._has_min = true;
205 }
206
207 /***
208 * Method unmarshalWavelengthRange
209 *
210 * @param reader
211 */
212 public static org.astrogrid.registry.beans.v10.resource.dataservice.WavelengthRange unmarshalWavelengthRange(java.io.Reader reader)
213 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
214 {
215 return (org.astrogrid.registry.beans.v10.resource.dataservice.WavelengthRange) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.dataservice.WavelengthRange.class, reader);
216 }
217
218 /***
219 * Method validate
220 */
221 public void validate()
222 throws org.exolab.castor.xml.ValidationException
223 {
224 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
225 validator.validate(this);
226 }
227
228 }