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