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