1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.votable;
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 FITS.
26 *
27 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:14 $
28 */
29 public class FITS extends org.astrogrid.registry.beans.resource.votable.StreamTABLEFORMATType
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * Field _extnum
40 */
41 private int _extnum;
42
43 /***
44 * keeps track of state for field: _extnum
45 */
46 private boolean _has_extnum;
47
48
49
50
51
52
53 public FITS() {
54 super();
55 }
56
57
58
59
60
61
62 /***
63 * Method deleteExtnum
64 */
65 public void deleteExtnum()
66 {
67 this._has_extnum= false;
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 FITS) {
84
85 FITS temp = (FITS)obj;
86 if (this._extnum != temp._extnum)
87 return false;
88 if (this._has_extnum != temp._has_extnum)
89 return false;
90 return true;
91 }
92 return false;
93 }
94
95 /***
96 * Returns the value of field 'extnum'.
97 *
98 * @return the value of field 'extnum'.
99 */
100 public int getExtnum()
101 {
102 return this._extnum;
103 }
104
105 /***
106 * Method hasExtnum
107 */
108 public boolean hasExtnum()
109 {
110 return this._has_extnum;
111 }
112
113 /***
114 * Method isValid
115 */
116 public boolean isValid()
117 {
118 try {
119 validate();
120 }
121 catch (org.exolab.castor.xml.ValidationException vex) {
122 return false;
123 }
124 return true;
125 }
126
127 /***
128 * Method marshal
129 *
130 * @param out
131 */
132 public void marshal(java.io.Writer out)
133 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
134 {
135
136 Marshaller.marshal(this, out);
137 }
138
139 /***
140 * Method marshal
141 *
142 * @param handler
143 */
144 public void marshal(org.xml.sax.ContentHandler handler)
145 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
146 {
147
148 Marshaller.marshal(this, handler);
149 }
150
151 /***
152 * Sets the value of field 'extnum'.
153 *
154 * @param extnum the value of field 'extnum'.
155 */
156 public void setExtnum(int extnum)
157 {
158 this._extnum = extnum;
159 this._has_extnum = true;
160 }
161
162 /***
163 * Method unmarshalFITS
164 *
165 * @param reader
166 */
167 public static org.astrogrid.registry.beans.resource.votable.FITS unmarshalFITS(java.io.Reader reader)
168 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
169 {
170 return (org.astrogrid.registry.beans.resource.votable.FITS) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.votable.FITS.class, reader);
171 }
172
173 /***
174 * Method validate
175 */
176 public void validate()
177 throws org.exolab.castor.xml.ValidationException
178 {
179 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
180 validator.validate(this);
181 }
182
183 }