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