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