JAL-1620 version bump and release notes
[jalview.git] / src / jalview / binding / Feature.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
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.binding;
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 Feature.
32  * 
33  * @version $Revision$ $Date$
34  */
35 public class Feature implements java.io.Serializable
36 {
37
38   // --------------------------/
39   // - Class/Member Variables -/
40   // --------------------------/
41
42   /**
43    * Field _begin.
44    */
45   private int _begin;
46
47   /**
48    * keeps track of state for field: _begin
49    */
50   private boolean _has_begin;
51
52   /**
53    * Field _end.
54    */
55   private int _end;
56
57   /**
58    * keeps track of state for field: _end
59    */
60   private boolean _has_end;
61
62   /**
63    * Field _type.
64    */
65   private java.lang.String _type;
66
67   /**
68    * Field _description.
69    */
70   private java.lang.String _description;
71
72   /**
73    * Field _status.
74    */
75   private java.lang.String _status;
76
77   // ----------------/
78   // - Constructors -/
79   // ----------------/
80
81   public Feature()
82   {
83     super();
84   }
85
86   // -----------/
87   // - Methods -/
88   // -----------/
89
90   /**
91      */
92   public void deleteBegin()
93   {
94     this._has_begin = false;
95   }
96
97   /**
98      */
99   public void deleteEnd()
100   {
101     this._has_end = false;
102   }
103
104   /**
105    * Returns the value of field 'begin'.
106    * 
107    * @return the value of field 'Begin'.
108    */
109   public int getBegin()
110   {
111     return this._begin;
112   }
113
114   /**
115    * Returns the value of field 'description'.
116    * 
117    * @return the value of field 'Description'.
118    */
119   public java.lang.String getDescription()
120   {
121     return this._description;
122   }
123
124   /**
125    * Returns the value of field 'end'.
126    * 
127    * @return the value of field 'End'.
128    */
129   public int getEnd()
130   {
131     return this._end;
132   }
133
134   /**
135    * Returns the value of field 'status'.
136    * 
137    * @return the value of field 'Status'.
138    */
139   public java.lang.String getStatus()
140   {
141     return this._status;
142   }
143
144   /**
145    * Returns the value of field 'type'.
146    * 
147    * @return the value of field 'Type'.
148    */
149   public java.lang.String getType()
150   {
151     return this._type;
152   }
153
154   /**
155    * Method hasBegin.
156    * 
157    * @return true if at least one Begin has been added
158    */
159   public boolean hasBegin()
160   {
161     return this._has_begin;
162   }
163
164   /**
165    * Method hasEnd.
166    * 
167    * @return true if at least one End has been added
168    */
169   public boolean hasEnd()
170   {
171     return this._has_end;
172   }
173
174   /**
175    * Method isValid.
176    * 
177    * @return true if this object is valid according to the schema
178    */
179   public boolean isValid()
180   {
181     try
182     {
183       validate();
184     } catch (org.exolab.castor.xml.ValidationException vex)
185     {
186       return false;
187     }
188     return true;
189   }
190
191   /**
192    * 
193    * 
194    * @param out
195    * @throws org.exolab.castor.xml.MarshalException
196    *           if object is null or if any SAXException is thrown during
197    *           marshaling
198    * @throws org.exolab.castor.xml.ValidationException
199    *           if this object is an invalid instance according to the schema
200    */
201   public void marshal(final java.io.Writer out)
202           throws org.exolab.castor.xml.MarshalException,
203           org.exolab.castor.xml.ValidationException
204   {
205     Marshaller.marshal(this, out);
206   }
207
208   /**
209    * 
210    * 
211    * @param handler
212    * @throws java.io.IOException
213    *           if an IOException occurs during marshaling
214    * @throws org.exolab.castor.xml.ValidationException
215    *           if this object is an invalid instance according to the schema
216    * @throws org.exolab.castor.xml.MarshalException
217    *           if object is null or if any SAXException is thrown during
218    *           marshaling
219    */
220   public void marshal(final org.xml.sax.ContentHandler handler)
221           throws java.io.IOException,
222           org.exolab.castor.xml.MarshalException,
223           org.exolab.castor.xml.ValidationException
224   {
225     Marshaller.marshal(this, handler);
226   }
227
228   /**
229    * Sets the value of field 'begin'.
230    * 
231    * @param begin
232    *          the value of field 'begin'.
233    */
234   public void setBegin(final int begin)
235   {
236     this._begin = begin;
237     this._has_begin = true;
238   }
239
240   /**
241    * Sets the value of field 'description'.
242    * 
243    * @param description
244    *          the value of field 'description'.
245    */
246   public void setDescription(final java.lang.String description)
247   {
248     this._description = description;
249   }
250
251   /**
252    * Sets the value of field 'end'.
253    * 
254    * @param end
255    *          the value of field 'end'.
256    */
257   public void setEnd(final int end)
258   {
259     this._end = end;
260     this._has_end = true;
261   }
262
263   /**
264    * Sets the value of field 'status'.
265    * 
266    * @param status
267    *          the value of field 'status'.
268    */
269   public void setStatus(final java.lang.String status)
270   {
271     this._status = status;
272   }
273
274   /**
275    * Sets the value of field 'type'.
276    * 
277    * @param type
278    *          the value of field 'type'.
279    */
280   public void setType(final java.lang.String type)
281   {
282     this._type = type;
283   }
284
285   /**
286    * Method unmarshal.
287    * 
288    * @param reader
289    * @throws org.exolab.castor.xml.MarshalException
290    *           if object is null or if any SAXException is thrown during
291    *           marshaling
292    * @throws org.exolab.castor.xml.ValidationException
293    *           if this object is an invalid instance according to the schema
294    * @return the unmarshaled jalview.binding.Feature
295    */
296   public static jalview.binding.Feature unmarshal(
297           final java.io.Reader reader)
298           throws org.exolab.castor.xml.MarshalException,
299           org.exolab.castor.xml.ValidationException
300   {
301     return (jalview.binding.Feature) Unmarshaller.unmarshal(
302             jalview.binding.Feature.class, reader);
303   }
304
305   /**
306    * 
307    * 
308    * @throws org.exolab.castor.xml.ValidationException
309    *           if this object is an invalid instance according to the schema
310    */
311   public void validate() throws org.exolab.castor.xml.ValidationException
312   {
313     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
314     validator.validate(this);
315   }
316
317 }