ba8103a2a13f9e089d3f7a475be791f19def2c6f
[jalview.git] / src / jalview / binding / Feature.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3  * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
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       //----------------/
77      //- Constructors -/
78     //----------------/
79
80     public Feature() {
81         super();
82     }
83
84
85       //-----------/
86      //- Methods -/
87     //-----------/
88
89     /**
90      */
91     public void deleteBegin(
92     ) {
93         this._has_begin= false;
94     }
95
96     /**
97      */
98     public void deleteEnd(
99     ) {
100         this._has_end= false;
101     }
102
103     /**
104      * Returns the value of field 'begin'.
105      * 
106      * @return the value of field 'Begin'.
107      */
108     public int getBegin(
109     ) {
110         return this._begin;
111     }
112
113     /**
114      * Returns the value of field 'description'.
115      * 
116      * @return the value of field 'Description'.
117      */
118     public java.lang.String getDescription(
119     ) {
120         return this._description;
121     }
122
123     /**
124      * Returns the value of field 'end'.
125      * 
126      * @return the value of field 'End'.
127      */
128     public int getEnd(
129     ) {
130         return this._end;
131     }
132
133     /**
134      * Returns the value of field 'status'.
135      * 
136      * @return the value of field 'Status'.
137      */
138     public java.lang.String getStatus(
139     ) {
140         return this._status;
141     }
142
143     /**
144      * Returns the value of field 'type'.
145      * 
146      * @return the value of field 'Type'.
147      */
148     public java.lang.String getType(
149     ) {
150         return this._type;
151     }
152
153     /**
154      * Method hasBegin.
155      * 
156      * @return true if at least one Begin has been added
157      */
158     public boolean hasBegin(
159     ) {
160         return this._has_begin;
161     }
162
163     /**
164      * Method hasEnd.
165      * 
166      * @return true if at least one End has been added
167      */
168     public boolean hasEnd(
169     ) {
170         return this._has_end;
171     }
172
173     /**
174      * Method isValid.
175      * 
176      * @return true if this object is valid according to the schema
177      */
178     public boolean isValid(
179     ) {
180         try {
181             validate();
182         } catch (org.exolab.castor.xml.ValidationException vex) {
183             return false;
184         }
185         return true;
186     }
187
188     /**
189      * 
190      * 
191      * @param out
192      * @throws org.exolab.castor.xml.MarshalException if object is
193      * null or if any SAXException is thrown during marshaling
194      * @throws org.exolab.castor.xml.ValidationException if this
195      * object is an invalid instance according to the schema
196      */
197     public void marshal(
198             final java.io.Writer out)
199     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
200         Marshaller.marshal(this, out);
201     }
202
203     /**
204      * 
205      * 
206      * @param handler
207      * @throws java.io.IOException if an IOException occurs during
208      * marshaling
209      * @throws org.exolab.castor.xml.ValidationException if this
210      * object is an invalid instance according to the schema
211      * @throws org.exolab.castor.xml.MarshalException if object is
212      * null or if any SAXException is thrown during marshaling
213      */
214     public void marshal(
215             final org.xml.sax.ContentHandler handler)
216     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
217         Marshaller.marshal(this, handler);
218     }
219
220     /**
221      * Sets the value of field 'begin'.
222      * 
223      * @param begin the value of field 'begin'.
224      */
225     public void setBegin(
226             final int begin) {
227         this._begin = begin;
228         this._has_begin = true;
229     }
230
231     /**
232      * Sets the value of field 'description'.
233      * 
234      * @param description the value of field 'description'.
235      */
236     public void setDescription(
237             final java.lang.String description) {
238         this._description = description;
239     }
240
241     /**
242      * Sets the value of field 'end'.
243      * 
244      * @param end the value of field 'end'.
245      */
246     public void setEnd(
247             final int end) {
248         this._end = end;
249         this._has_end = true;
250     }
251
252     /**
253      * Sets the value of field 'status'.
254      * 
255      * @param status the value of field 'status'.
256      */
257     public void setStatus(
258             final java.lang.String status) {
259         this._status = status;
260     }
261
262     /**
263      * Sets the value of field 'type'.
264      * 
265      * @param type the value of field 'type'.
266      */
267     public void setType(
268             final java.lang.String type) {
269         this._type = type;
270     }
271
272     /**
273      * Method unmarshal.
274      * 
275      * @param reader
276      * @throws org.exolab.castor.xml.MarshalException if object is
277      * null or if any SAXException is thrown during marshaling
278      * @throws org.exolab.castor.xml.ValidationException if this
279      * object is an invalid instance according to the schema
280      * @return the unmarshaled jalview.binding.Feature
281      */
282     public static jalview.binding.Feature unmarshal(
283             final java.io.Reader reader)
284     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
285         return (jalview.binding.Feature) Unmarshaller.unmarshal(jalview.binding.Feature.class, reader);
286     }
287
288     /**
289      * 
290      * 
291      * @throws org.exolab.castor.xml.ValidationException if this
292      * object is an invalid instance according to the schema
293      */
294     public void validate(
295     )
296     throws org.exolab.castor.xml.ValidationException {
297         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
298         validator.validate(this);
299     }
300
301 }