b382ac8a5c33c12e0d420ca3efb3215674f0fb87
[jalview.git] / src / jalview / schemabinding / version2 / Alcodon.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 Alcodon.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class Alcodon implements java.io.Serializable
33 {
34
35   // --------------------------/
36   // - Class/Member Variables -/
37   // --------------------------/
38
39   /**
40    * Field _pos1.
41    */
42   private long _pos1;
43
44   /**
45    * keeps track of state for field: _pos1
46    */
47   private boolean _has_pos1;
48
49   /**
50    * Field _pos2.
51    */
52   private long _pos2;
53
54   /**
55    * keeps track of state for field: _pos2
56    */
57   private boolean _has_pos2;
58
59   /**
60    * Field _pos3.
61    */
62   private long _pos3;
63
64   /**
65    * keeps track of state for field: _pos3
66    */
67   private boolean _has_pos3;
68
69   // ----------------/
70   // - Constructors -/
71   // ----------------/
72
73   public Alcodon()
74   {
75     super();
76   }
77
78   // -----------/
79   // - Methods -/
80   // -----------/
81
82   /**
83      */
84   public void deletePos1()
85   {
86     this._has_pos1 = false;
87   }
88
89   /**
90      */
91   public void deletePos2()
92   {
93     this._has_pos2 = false;
94   }
95
96   /**
97      */
98   public void deletePos3()
99   {
100     this._has_pos3 = false;
101   }
102
103   /**
104    * Returns the value of field 'pos1'.
105    * 
106    * @return the value of field 'Pos1'.
107    */
108   public long getPos1()
109   {
110     return this._pos1;
111   }
112
113   /**
114    * Returns the value of field 'pos2'.
115    * 
116    * @return the value of field 'Pos2'.
117    */
118   public long getPos2()
119   {
120     return this._pos2;
121   }
122
123   /**
124    * Returns the value of field 'pos3'.
125    * 
126    * @return the value of field 'Pos3'.
127    */
128   public long getPos3()
129   {
130     return this._pos3;
131   }
132
133   /**
134    * Method hasPos1.
135    * 
136    * @return true if at least one Pos1 has been added
137    */
138   public boolean hasPos1()
139   {
140     return this._has_pos1;
141   }
142
143   /**
144    * Method hasPos2.
145    * 
146    * @return true if at least one Pos2 has been added
147    */
148   public boolean hasPos2()
149   {
150     return this._has_pos2;
151   }
152
153   /**
154    * Method hasPos3.
155    * 
156    * @return true if at least one Pos3 has been added
157    */
158   public boolean hasPos3()
159   {
160     return this._has_pos3;
161   }
162
163   /**
164    * Method isValid.
165    * 
166    * @return true if this object is valid according to the schema
167    */
168   public boolean isValid()
169   {
170     try
171     {
172       validate();
173     } catch (org.exolab.castor.xml.ValidationException vex)
174     {
175       return false;
176     }
177     return true;
178   }
179
180   /**
181    * 
182    * 
183    * @param out
184    * @throws org.exolab.castor.xml.MarshalException
185    *           if object is null or if any SAXException is thrown during
186    *           marshaling
187    * @throws org.exolab.castor.xml.ValidationException
188    *           if this object is an invalid instance according to the schema
189    */
190   public void marshal(final java.io.Writer out)
191           throws org.exolab.castor.xml.MarshalException,
192           org.exolab.castor.xml.ValidationException
193   {
194     Marshaller.marshal(this, out);
195   }
196
197   /**
198    * 
199    * 
200    * @param handler
201    * @throws java.io.IOException
202    *           if an IOException occurs during marshaling
203    * @throws org.exolab.castor.xml.ValidationException
204    *           if this object is an invalid instance according to the schema
205    * @throws org.exolab.castor.xml.MarshalException
206    *           if object is null or if any SAXException is thrown during
207    *           marshaling
208    */
209   public void marshal(final org.xml.sax.ContentHandler handler)
210           throws java.io.IOException,
211           org.exolab.castor.xml.MarshalException,
212           org.exolab.castor.xml.ValidationException
213   {
214     Marshaller.marshal(this, handler);
215   }
216
217   /**
218    * Sets the value of field 'pos1'.
219    * 
220    * @param pos1
221    *          the value of field 'pos1'.
222    */
223   public void setPos1(final long pos1)
224   {
225     this._pos1 = pos1;
226     this._has_pos1 = true;
227   }
228
229   /**
230    * Sets the value of field 'pos2'.
231    * 
232    * @param pos2
233    *          the value of field 'pos2'.
234    */
235   public void setPos2(final long pos2)
236   {
237     this._pos2 = pos2;
238     this._has_pos2 = true;
239   }
240
241   /**
242    * Sets the value of field 'pos3'.
243    * 
244    * @param pos3
245    *          the value of field 'pos3'.
246    */
247   public void setPos3(final long pos3)
248   {
249     this._pos3 = pos3;
250     this._has_pos3 = true;
251   }
252
253   /**
254    * Method unmarshal.
255    * 
256    * @param reader
257    * @throws org.exolab.castor.xml.MarshalException
258    *           if object is null or if any SAXException is thrown during
259    *           marshaling
260    * @throws org.exolab.castor.xml.ValidationException
261    *           if this object is an invalid instance according to the schema
262    * @return the unmarshaled jalview.schemabinding.version2.Alcodo
263    */
264   public static jalview.schemabinding.version2.Alcodon unmarshal(
265           final java.io.Reader reader)
266           throws org.exolab.castor.xml.MarshalException,
267           org.exolab.castor.xml.ValidationException
268   {
269     return (jalview.schemabinding.version2.Alcodon) Unmarshaller.unmarshal(
270             jalview.schemabinding.version2.Alcodon.class, reader);
271   }
272
273   /**
274    * 
275    * 
276    * @throws org.exolab.castor.xml.ValidationException
277    *           if this object is an invalid instance according to the schema
278    */
279   public void validate() throws org.exolab.castor.xml.ValidationException
280   {
281     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
282     validator.validate(this);
283   }
284
285 }