be00b2f67a8ea29848180ca668585069b38fac71
[jalview.git] / src / jalview / schemabinding / version2 / CalcIdParam.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package jalview.schemabinding.version2;
19
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
23
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
26
27 /**
28  * Class CalcIdParam.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class CalcIdParam extends WebServiceParameterSet implements
33         java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * handle for the calculation which uses this parameter set
42    */
43   private java.lang.String _calcId;
44
45   /**
46    * should the calculation be performed immediately after loading in order to
47    * refresh results
48    */
49   private boolean _needsUpdate = false;
50
51   /**
52    * keeps track of state for field: _needsUpdate
53    */
54   private boolean _has_needsUpdate;
55
56   /**
57    * should the calculation be automatically performed on edits
58    */
59   private boolean _autoUpdate;
60
61   /**
62    * keeps track of state for field: _autoUpdate
63    */
64   private boolean _has_autoUpdate;
65
66   // ----------------/
67   // - Constructors -/
68   // ----------------/
69
70   public CalcIdParam()
71   {
72     super();
73   }
74
75   // -----------/
76   // - Methods -/
77   // -----------/
78
79   /**
80      */
81   public void deleteAutoUpdate()
82   {
83     this._has_autoUpdate = false;
84   }
85
86   /**
87      */
88   public void deleteNeedsUpdate()
89   {
90     this._has_needsUpdate = false;
91   }
92
93   /**
94    * Returns the value of field 'autoUpdate'. The field 'autoUpdate' has the
95    * following description: should the calculation be automatically performed on
96    * edits
97    * 
98    * @return the value of field 'AutoUpdate'.
99    */
100   public boolean getAutoUpdate()
101   {
102     return this._autoUpdate;
103   }
104
105   /**
106    * Returns the value of field 'calcId'. The field 'calcId' has the following
107    * description: handle for the calculation which uses this parameter set
108    * 
109    * @return the value of field 'CalcId'.
110    */
111   public java.lang.String getCalcId()
112   {
113     return this._calcId;
114   }
115
116   /**
117    * Returns the value of field 'needsUpdate'. The field 'needsUpdate' has the
118    * following description: should the calculation be performed immediately
119    * after loading in order to refresh results
120    * 
121    * @return the value of field 'NeedsUpdate'.
122    */
123   public boolean getNeedsUpdate()
124   {
125     return this._needsUpdate;
126   }
127
128   /**
129    * Method hasAutoUpdate.
130    * 
131    * @return true if at least one AutoUpdate has been added
132    */
133   public boolean hasAutoUpdate()
134   {
135     return this._has_autoUpdate;
136   }
137
138   /**
139    * Method hasNeedsUpdate.
140    * 
141    * @return true if at least one NeedsUpdate has been added
142    */
143   public boolean hasNeedsUpdate()
144   {
145     return this._has_needsUpdate;
146   }
147
148   /**
149    * Returns the value of field 'autoUpdate'. The field 'autoUpdate' has the
150    * following description: should the calculation be automatically performed on
151    * edits
152    * 
153    * @return the value of field 'AutoUpdate'.
154    */
155   public boolean isAutoUpdate()
156   {
157     return this._autoUpdate;
158   }
159
160   /**
161    * Returns the value of field 'needsUpdate'. The field 'needsUpdate' has the
162    * following description: should the calculation be performed immediately
163    * after loading in order to refresh results
164    * 
165    * @return the value of field 'NeedsUpdate'.
166    */
167   public boolean isNeedsUpdate()
168   {
169     return this._needsUpdate;
170   }
171
172   /**
173    * Method isValid.
174    * 
175    * @return true if this object is valid according to the schema
176    */
177   public boolean isValid()
178   {
179     try
180     {
181       validate();
182     } catch (org.exolab.castor.xml.ValidationException vex)
183     {
184       return false;
185     }
186     return true;
187   }
188
189   /**
190    * 
191    * 
192    * @param out
193    * @throws org.exolab.castor.xml.MarshalException
194    *           if object is null or if any SAXException is thrown during
195    *           marshaling
196    * @throws org.exolab.castor.xml.ValidationException
197    *           if this object is an invalid instance according to the schema
198    */
199   public void marshal(final java.io.Writer out)
200           throws org.exolab.castor.xml.MarshalException,
201           org.exolab.castor.xml.ValidationException
202   {
203     Marshaller.marshal(this, out);
204   }
205
206   /**
207    * 
208    * 
209    * @param handler
210    * @throws java.io.IOException
211    *           if an IOException occurs during marshaling
212    * @throws org.exolab.castor.xml.ValidationException
213    *           if this object is an invalid instance according to the schema
214    * @throws org.exolab.castor.xml.MarshalException
215    *           if object is null or if any SAXException is thrown during
216    *           marshaling
217    */
218   public void marshal(final org.xml.sax.ContentHandler handler)
219           throws java.io.IOException,
220           org.exolab.castor.xml.MarshalException,
221           org.exolab.castor.xml.ValidationException
222   {
223     Marshaller.marshal(this, handler);
224   }
225
226   /**
227    * Sets the value of field 'autoUpdate'. The field 'autoUpdate' has the
228    * following description: should the calculation be automatically performed on
229    * edits
230    * 
231    * @param autoUpdate
232    *          the value of field 'autoUpdate'.
233    */
234   public void setAutoUpdate(final boolean autoUpdate)
235   {
236     this._autoUpdate = autoUpdate;
237     this._has_autoUpdate = true;
238   }
239
240   /**
241    * Sets the value of field 'calcId'. The field 'calcId' has the following
242    * description: handle for the calculation which uses this parameter set
243    * 
244    * @param calcId
245    *          the value of field 'calcId'.
246    */
247   public void setCalcId(final java.lang.String calcId)
248   {
249     this._calcId = calcId;
250   }
251
252   /**
253    * Sets the value of field 'needsUpdate'. The field 'needsUpdate' has the
254    * following description: should the calculation be performed immediately
255    * after loading in order to refresh results
256    * 
257    * @param needsUpdate
258    *          the value of field 'needsUpdate'.
259    */
260   public void setNeedsUpdate(final boolean needsUpdate)
261   {
262     this._needsUpdate = needsUpdate;
263     this._has_needsUpdate = true;
264   }
265
266   /**
267    * Method unmarshal.
268    * 
269    * @param reader
270    * @throws org.exolab.castor.xml.MarshalException
271    *           if object is null or if any SAXException is thrown during
272    *           marshaling
273    * @throws org.exolab.castor.xml.ValidationException
274    *           if this object is an invalid instance according to the schema
275    * @return the unmarshaled jalview.schemabinding.version2.CalcIdParam
276    */
277   public static jalview.schemabinding.version2.CalcIdParam unmarshal(
278           final java.io.Reader reader)
279           throws org.exolab.castor.xml.MarshalException,
280           org.exolab.castor.xml.ValidationException
281   {
282     return (jalview.schemabinding.version2.CalcIdParam) Unmarshaller
283             .unmarshal(jalview.schemabinding.version2.CalcIdParam.class,
284                     reader);
285   }
286
287   /**
288    * 
289    * 
290    * @throws org.exolab.castor.xml.ValidationException
291    *           if this object is an invalid instance according to the schema
292    */
293   public void validate() throws org.exolab.castor.xml.ValidationException
294   {
295     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
296     validator.validate(this);
297   }
298
299 }