JAL-1432 updated copyright notices
[jalview.git] / src / jalview / schemabinding / version2 / MapListFrom.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.schemabinding.version2;
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  * a region from start to end inclusive
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class MapListFrom implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * Field _start.
42    */
43   private int _start;
44
45   /**
46    * keeps track of state for field: _start
47    */
48   private boolean _has_start;
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   // - Constructors -/
62   // ----------------/
63
64   public MapListFrom()
65   {
66     super();
67   }
68
69   // -----------/
70   // - Methods -/
71   // -----------/
72
73   /**
74      */
75   public void deleteEnd()
76   {
77     this._has_end = false;
78   }
79
80   /**
81      */
82   public void deleteStart()
83   {
84     this._has_start = false;
85   }
86
87   /**
88    * Returns the value of field 'end'.
89    * 
90    * @return the value of field 'End'.
91    */
92   public int getEnd()
93   {
94     return this._end;
95   }
96
97   /**
98    * Returns the value of field 'start'.
99    * 
100    * @return the value of field 'Start'.
101    */
102   public int getStart()
103   {
104     return this._start;
105   }
106
107   /**
108    * Method hasEnd.
109    * 
110    * @return true if at least one End has been added
111    */
112   public boolean hasEnd()
113   {
114     return this._has_end;
115   }
116
117   /**
118    * Method hasStart.
119    * 
120    * @return true if at least one Start has been added
121    */
122   public boolean hasStart()
123   {
124     return this._has_start;
125   }
126
127   /**
128    * Method isValid.
129    * 
130    * @return true if this object is valid according to the schema
131    */
132   public boolean isValid()
133   {
134     try
135     {
136       validate();
137     } catch (org.exolab.castor.xml.ValidationException vex)
138     {
139       return false;
140     }
141     return true;
142   }
143
144   /**
145    * 
146    * 
147    * @param out
148    * @throws org.exolab.castor.xml.MarshalException
149    *           if object is null or if any SAXException is thrown during
150    *           marshaling
151    * @throws org.exolab.castor.xml.ValidationException
152    *           if this object is an invalid instance according to the schema
153    */
154   public void marshal(final java.io.Writer out)
155           throws org.exolab.castor.xml.MarshalException,
156           org.exolab.castor.xml.ValidationException
157   {
158     Marshaller.marshal(this, out);
159   }
160
161   /**
162    * 
163    * 
164    * @param handler
165    * @throws java.io.IOException
166    *           if an IOException occurs during marshaling
167    * @throws org.exolab.castor.xml.ValidationException
168    *           if this object is an invalid instance according to the schema
169    * @throws org.exolab.castor.xml.MarshalException
170    *           if object is null or if any SAXException is thrown during
171    *           marshaling
172    */
173   public void marshal(final org.xml.sax.ContentHandler handler)
174           throws java.io.IOException,
175           org.exolab.castor.xml.MarshalException,
176           org.exolab.castor.xml.ValidationException
177   {
178     Marshaller.marshal(this, handler);
179   }
180
181   /**
182    * Sets the value of field 'end'.
183    * 
184    * @param end
185    *          the value of field 'end'.
186    */
187   public void setEnd(final int end)
188   {
189     this._end = end;
190     this._has_end = true;
191   }
192
193   /**
194    * Sets the value of field 'start'.
195    * 
196    * @param start
197    *          the value of field 'start'.
198    */
199   public void setStart(final int start)
200   {
201     this._start = start;
202     this._has_start = true;
203   }
204
205   /**
206    * Method unmarshal.
207    * 
208    * @param reader
209    * @throws org.exolab.castor.xml.MarshalException
210    *           if object is null or if any SAXException is thrown during
211    *           marshaling
212    * @throws org.exolab.castor.xml.ValidationException
213    *           if this object is an invalid instance according to the schema
214    * @return the unmarshaled jalview.schemabinding.version2.MapListFrom
215    */
216   public static jalview.schemabinding.version2.MapListFrom unmarshal(
217           final java.io.Reader reader)
218           throws org.exolab.castor.xml.MarshalException,
219           org.exolab.castor.xml.ValidationException
220   {
221     return (jalview.schemabinding.version2.MapListFrom) Unmarshaller
222             .unmarshal(jalview.schemabinding.version2.MapListFrom.class,
223                     reader);
224   }
225
226   /**
227    * 
228    * 
229    * @throws org.exolab.castor.xml.ValidationException
230    *           if this object is an invalid instance according to the schema
231    */
232   public void validate() throws org.exolab.castor.xml.ValidationException
233   {
234     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
235     validator.validate(this);
236   }
237
238 }