View Javadoc

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