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