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