apply gpl development license
[jalview.git] / src / jalview / schemabinding / version2 / MapListFrom.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
3  * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  * \r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License\r
7  * as published by the Free Software Foundation; either version 2\r
8  * of the License, or (at your option) any later version.\r
9  * \r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  * \r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18  */\r
19 package jalview.schemabinding.version2;\r
20 \r
21   //---------------------------------/\r
22  //- Imported classes and packages -/\r
23 //---------------------------------/\r
24 \r
25 import org.exolab.castor.xml.Marshaller;\r
26 import org.exolab.castor.xml.Unmarshaller;\r
27 \r
28 /**\r
29  * a region from start to end inclusive\r
30  * \r
31  * @version $Revision$ $Date$\r
32  */\r
33 public class MapListFrom implements java.io.Serializable {\r
34 \r
35 \r
36       //--------------------------/\r
37      //- Class/Member Variables -/\r
38     //--------------------------/\r
39 \r
40     /**\r
41      * Field _start.\r
42      */\r
43     private int _start;\r
44 \r
45     /**\r
46      * keeps track of state for field: _start\r
47      */\r
48     private boolean _has_start;\r
49 \r
50     /**\r
51      * Field _end.\r
52      */\r
53     private int _end;\r
54 \r
55     /**\r
56      * keeps track of state for field: _end\r
57      */\r
58     private boolean _has_end;\r
59 \r
60 \r
61       //----------------/\r
62      //- Constructors -/\r
63     //----------------/\r
64 \r
65     public MapListFrom() {\r
66         super();\r
67     }\r
68 \r
69 \r
70       //-----------/\r
71      //- Methods -/\r
72     //-----------/\r
73 \r
74     /**\r
75      */\r
76     public void deleteEnd(\r
77     ) {\r
78         this._has_end= false;\r
79     }\r
80 \r
81     /**\r
82      */\r
83     public void deleteStart(\r
84     ) {\r
85         this._has_start= false;\r
86     }\r
87 \r
88     /**\r
89      * Returns the value of field 'end'.\r
90      * \r
91      * @return the value of field 'End'.\r
92      */\r
93     public int getEnd(\r
94     ) {\r
95         return this._end;\r
96     }\r
97 \r
98     /**\r
99      * Returns the value of field 'start'.\r
100      * \r
101      * @return the value of field 'Start'.\r
102      */\r
103     public int getStart(\r
104     ) {\r
105         return this._start;\r
106     }\r
107 \r
108     /**\r
109      * Method hasEnd.\r
110      * \r
111      * @return true if at least one End has been added\r
112      */\r
113     public boolean hasEnd(\r
114     ) {\r
115         return this._has_end;\r
116     }\r
117 \r
118     /**\r
119      * Method hasStart.\r
120      * \r
121      * @return true if at least one Start has been added\r
122      */\r
123     public boolean hasStart(\r
124     ) {\r
125         return this._has_start;\r
126     }\r
127 \r
128     /**\r
129      * Method isValid.\r
130      * \r
131      * @return true if this object is valid according to the schema\r
132      */\r
133     public boolean isValid(\r
134     ) {\r
135         try {\r
136             validate();\r
137         } catch (org.exolab.castor.xml.ValidationException vex) {\r
138             return false;\r
139         }\r
140         return true;\r
141     }\r
142 \r
143     /**\r
144      * \r
145      * \r
146      * @param out\r
147      * @throws org.exolab.castor.xml.MarshalException if object is\r
148      * null or if any SAXException is thrown during marshaling\r
149      * @throws org.exolab.castor.xml.ValidationException if this\r
150      * object is an invalid instance according to the schema\r
151      */\r
152     public void marshal(\r
153             final java.io.Writer out)\r
154     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
155         Marshaller.marshal(this, out);\r
156     }\r
157 \r
158     /**\r
159      * \r
160      * \r
161      * @param handler\r
162      * @throws java.io.IOException if an IOException occurs during\r
163      * marshaling\r
164      * @throws org.exolab.castor.xml.ValidationException if this\r
165      * object is an invalid instance according to the schema\r
166      * @throws org.exolab.castor.xml.MarshalException if object is\r
167      * null or if any SAXException is thrown during marshaling\r
168      */\r
169     public void marshal(\r
170             final org.xml.sax.ContentHandler handler)\r
171     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
172         Marshaller.marshal(this, handler);\r
173     }\r
174 \r
175     /**\r
176      * Sets the value of field 'end'.\r
177      * \r
178      * @param end the value of field 'end'.\r
179      */\r
180     public void setEnd(\r
181             final int end) {\r
182         this._end = end;\r
183         this._has_end = true;\r
184     }\r
185 \r
186     /**\r
187      * Sets the value of field 'start'.\r
188      * \r
189      * @param start the value of field 'start'.\r
190      */\r
191     public void setStart(\r
192             final int start) {\r
193         this._start = start;\r
194         this._has_start = true;\r
195     }\r
196 \r
197     /**\r
198      * Method unmarshal.\r
199      * \r
200      * @param reader\r
201      * @throws org.exolab.castor.xml.MarshalException if object is\r
202      * null or if any SAXException is thrown during marshaling\r
203      * @throws org.exolab.castor.xml.ValidationException if this\r
204      * object is an invalid instance according to the schema\r
205      * @return the unmarshaled\r
206      * jalview.schemabinding.version2.MapListFrom\r
207      */\r
208     public static jalview.schemabinding.version2.MapListFrom unmarshal(\r
209             final java.io.Reader reader)\r
210     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
211         return (jalview.schemabinding.version2.MapListFrom) Unmarshaller.unmarshal(jalview.schemabinding.version2.MapListFrom.class, reader);\r
212     }\r
213 \r
214     /**\r
215      * \r
216      * \r
217      * @throws org.exolab.castor.xml.ValidationException if this\r
218      * object is an invalid instance according to the schema\r
219      */\r
220     public void validate(\r
221     )\r
222     throws org.exolab.castor.xml.ValidationException {\r
223         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
224         validator.validate(this);\r
225     }\r
226 \r
227 }\r